Sail E0 Webinar
Question
What is the output of this C code?
int main()
{
j = 10;
printf("%d\n", j++);
return 0;
}
Options:
A .  10
B .  11
C .  Compile time error
D .  0
Answer: Option C


Variable j is not defined.
Output:
$ cc pgm3.c
pgm3.c: In function 'main':
pgm3.c:4: error: 'j' undeclared (first use in this function)
pgm3.c:4: error: (Each undeclared identifier is reported only once
pgm3.c:4: error: for each function it appears in.)



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers