What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("examveda\r\nclass\n");
return 0;
}
#include <stdio.h>
int main()
{
printf("examveda\r\nclass\n");
return 0;
}
A. examvedaclass
B. examveda
class
C. classveda
D. examveda
Answer: Option B
Join The Discussion
Comments ( 1 )
Related Questions on C Fundamentals
What is the primary purpose of a function prototype in C?
A. Declare a variable
B. Declare a function
C. Define a function
D. Assign a value
What is the correct syntax for declaring a variable in C?
A. int variable_name;
B. variable_name = 5;
C. variable_name int;
D. int = variable_name;
correct answer should be option c
"examveda" followed by a carriage return (
), which moves the cursor to the beginning of the line, and then "class" will overwrite "exam" since it moves the cursor back to the beginning of the line.
"class" will be printed on the next line after "veda", resulting in the final output:
class
veda
veda in new line since there is an
after class