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

Home > Java Programming > Functions > Questions and Answers

Q: What is the output of following program?
void f1(){
static int s=5;
++s;
printf("%d",s);
}
main(){
f1();
f1();
printf("%d",s);
}
A. 6 6 6 B. 6 7 7
C. 6 7 6 D. error

Answer and Explanation

Answer:error

Explanation:
s in out of scope in main()   

Comment on this Question

Name:

Loading...




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