Discussion :: C-MCQs
-
What is the output of this C code?
int main()
{
printf("C programming %s", "Class by\n%s AllIndiaExams", "SUPER");
}
A.
C programming Class by SUPER AllIndiaExams
|
B.
C programming Class by\n%s AllIndiaExams
|
C.
C programming Class by %s AllIndiaExams
|
D.
Compilation error
|
Answer : Option C
Explanation :
This program has only one %s within first double quotes, so it does not read the string "SUPER.
The %s along with the AllIndiaExams is not read as a format modifier while new line character prints the new line.
Be The First To Comment