#include<stdio.h>
main()
{int i=1;j=1;
for(;;)
{if(i>5)
break;
else
j+=1;
printf("\n%d",j)
i+=j;
}
}




Answers were Sorted based on User's Feedback



Answer / radha raman

2
3

Is This Answer Correct ?    5 Yes 4 No

Answer / sourav basu

1 1

print statement is printing 'j', not 'i'. and the for loop works on the basis of value of 'i'..
tested and verified answer on gcc compiler

Is This Answer Correct ?    0 Yes 0 No

Answer / vedansh

2
3

Is This Answer Correct ?    2 Yes 4 No




Answer / ajay

error loop is incomplete

Is This Answer Correct ?    1 Yes 3 No

Answer / fa

1
1
1
1
1

Is This Answer Correct ?    0 Yes 2 No

Post New Answer



More C Interview Questions

Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

0 Answers  


Write a program that accept anumber in words

0 Answers  


Study the Following Points: a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static 1. Which of the Following Statements are true w.r.t Bit- Fields A)a,b&c B)Only a & b C)Only c D)All

3 Answers   Accenture,


Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... }

7 Answers   TCS,


what is the difference between char * const and const char *?

2 Answers   TCS,


two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast.

5 Answers   Verifone,


what are the interview question's in the language c

2 Answers   Nipuna,


what's the return value of malloc()

9 Answers  


Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 Answers  


write a C program to print the program itself ?!

16 Answers   TCS,


how to swap 2 numbers in a single statement?

2 Answers  


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

0 Answers  




Categories