a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6
Answers were Sorted based on User's Feedback
Answer / bharath kumar
Hello,
The answer is b.
a=0+1=1
a=1+1=2
a=2+1=3
a=3+1=4
a=4+1=5
While a variable is storing the 5 result a is nither less
then are equal to 5 hence the application will come out of
the loop.So while loop had run 5 times.
| Is This Answer Correct ? | 28 Yes | 4 No |
Answer / vikram
the output will be:
0
1
2
3
4
hence the loop will be executed 5 times,hence the answer is b
| Is This Answer Correct ? | 17 Yes | 2 No |
Answer / deepu_ashu
as the value of "a" increases after printing the value.
so it will print the value
0
1
2
3
4
but after printing the value 4 ,it becomes 5 for the next iteration.
so the condition becomes false.
the loop will not execute any more.
| Is This Answer Correct ? | 12 Yes | 1 No |
Answer / vignesh1988i
THIS LOOP OCCURS 5 TIMES. AT THE SIXTH TIME IT BECOMES FALSE
| Is This Answer Correct ? | 12 Yes | 2 No |
Answer / ankit rastogi
ans should be (a)infinite
bcoz every time a will be initialize with 0......
and increment values are displayed
a=1
a=2
a=3
a=4...................upto infinity......
| Is This Answer Correct ? | 4 Yes | 3 No |
Explain what is the difference between functions getch() and getche()?
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????
What is calloc in c?
Explain how do you print only part of a string?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
what is the significance of static storage class specifier?
What is keyword in c?
write c program to display output 10(10+20)+(10+20+30)+ ... n term
0 Answers Hindustan Gum Chemicals,
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
Explain output of printf("Hello World"-'A'+'B'); ?
How can we allocate array or structure bigger than 64kb?