ExamVeda
Login
Home
This question belongs to C Program C Fundamentals
C Fundamentals
?

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    printf("examveda\r\nclass\n");
    return 0;
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Aaniketh
Aaniketh 3 years ago
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