Examveda
Examveda

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

A. examvedaclass

B. examveda
class

C. classveda

D. examveda

Answer: Option B


This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Comments ( 1 )

  1. Aaniketh
    Aaniketh :
    3 months 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

Related Questions on C Fundamentals