What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 10000;
int y = 34;
printf(“Hello World! %d\n”, y);
return 0;
}
a) Compile time error
b) Hello World! 34
c) Hello World! followed by a junk value
d) Hello World! 10000
Answer: a
Explanation: Since y is already defined, redefining it results in an error.
Related Posts
The wrong statement regarding interrupts and subroutines among the following is/are ______
i) The sub-routine and interrupts have a return statement
ii) Both of them alter the content of the PC
iii) Both are software oriented
iv) Both can be initiated by the userThe most Flexible way of logging the return addresses of the subroutines is by using _______
The most efficient way of handling parameter passing is by using ______
When parameters are being passed on to the subroutines they are stored in ________
The appropriate return addresses are obtained with the help of ____ in case of nested routines.
In case of nested subroutines the return addresses are stored in __________
The order in which the return addresses are generated and used is _________
Join The Discussion