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

Home > Java Programming > Loops > Questions and Answers

Q: What is the output of the following code?
#include "stdio.h"
main()
{
int i;
for(i=0;i<5;i++)
{
static int a=0;
int b=0;
a++;
b++;
printf("%d %d",a,b);
}
return 0;
}
A. 1 1 2 1 3 1 4 1 4 1 B. 1 1 2 1 3 1 4 1 5 1
C. 1 0 2 0 3 1 4 1 5 1 D. 0 1 2 0 3 1 4 1 5 1

Answer and Explanation

Answer:1 1 2 1 3 1 4 1 5 1

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.