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

Home > Java Programming > Functions > Questions and Answers

Q: What will the code below print when it is executed?
#include
void func()
{
int x = 0;
static int y = 0;
x++; y++;
printf( "%d -- %d\n", x, y );
}

int main()
{
func();
func();
return 0;
}
A. 1 -- 1
1 – 1
B. 1 -- 1
2 – 1
C. 1 -- 1
2 – 2
D. 1 -- 1
1 -- 2

Answer and Explanation

Answer:1 -- 1
1 -- 2

Explanation:
There is no explanation...

Comment on this Question

Name:

Loading...




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