#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

what is the flow of execution in cprogram? ex:printf();,scanf();

2 Answers  


i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me

0 Answers   Microsoft,


Stimulate calculator using Switch-case-default statement for two numbers

0 Answers   Wipro,


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

0 Answers   Lovely Professional University,


is assignment operator is arithmatic or not

3 Answers   Infosys,


main() { int ptr[] = {1,2,23,6,5,6}; printf("%d",&ptr[3]-&ptr[0]); }

5 Answers   Vector,


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

0 Answers   Mindteck,


how to build a exercise findig min number of e heap with list imlemented?

0 Answers  


Please write the area of a RIGHT ANGLED TRIANGLE.

1 Answers  


Write a program for the following series? 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321 1234567890987654321 123456789010987654321 12345678901210987654321 1234567890123210987654321 .........1234321............ ..........123454321............ ..........12345654321............ 7 8 9 0 1 Pls............?

5 Answers  


What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }

7 Answers   TCS, Tech Mahindra, MindFire,


plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.

1 Answers  




Categories