Welcome Guest | Sign in | Register
Operators - Discussion Page For Q.10660 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Operators > Questions and Answers

Q: What will the output of following C code?
void main()
{
int i=i++,j=j++,k=k++;
printf(ā€œ%d%d%dā€,i,j,k);
}
A. Error B. Garbage values.
C. Compiler error D. No output

Answer and Explanation

Answer:Garbage values.

Explanation:
An identifier is available to use in program code from the point of its declaration.
So expressions such as i = i++ are valid statements. The i, j and k are automatic variables and so they contain some garbage value. Garbage in is garbage out (GIGO).

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.