11. What will be the output of the following program ? * Void main() { int x=24,y=30; printf ("\n%d",x,y); }
Answers
Answered by
0
Answer:
The question given isn't entirely correct. I'm sure this is what you mean.
#include<stdio.h>
void main(){
int x=24,y=30;
printf ("%d\n%d",x,y);
return 0;
}
Explanation:
int x=24,y=30;
Here, we declare x and y as variables of integer type storing constant values 24 and 30 respectively.
printf ("%d\n%d",x,y);
Here, %d is the specifier for integers. Since we are printing two integer variables we have "%d\n%d" where \n is an escape sequence for the new line. The program will still work if you remove \n but both the values of x and y will be printed on the same line.
Attachments:
Similar questions