Welcome Guest | Sign in | Register
Operators - Discussion Page For Q.10663 | 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()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
}
A. i = 2 j = 1 k = 1 B. i = 1 j = 2 k = 0
C. i = 0 j = 0 k = 0 D. i = 1 j = 1 k = 1

Answer and Explanation

Answer:i = 1 j = 1 k = 1

Explanation:
Since static variables are initialized to zero by default.

Comment on this Question

Name:

Loading...




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