int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i);

Answers were Sorted based on User's Feedback



int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d&quo..

Answer / jai

printf() will never be executed since for() is an infinite
loop.

Is This Answer Correct ?    30 Yes 2 No

int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d&quo..

Answer / vikramanj

int i=10[;]
main()
{
int i=20,n;
for(n=0;n<=i;)
{
int i=10[;]
i++;
}
printf("%d", i);
The syntax errs r specified in sq.braces..
if its corrected there s no terminating condition also..
so no o/p..

Is This Answer Correct ?    8 Yes 0 No

int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d&quo..

Answer / vignesh1988i

it will not print i value at all , since the loop is always
true for all cases. since the termination condition is
depending upon n&i,always n<=i, what ever possibe positive
value greater than zero ,it may be.

Is This Answer Correct ?    5 Yes 0 No

int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d&quo..

Answer / dips

it doesnt have any terminating condition so it will be
infinite loop ,no output

Is This Answer Correct ?    4 Yes 0 No

int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d&quo..

Answer / guest

the print would be 20.

the problem is about scope. the first i=10 is global scope.
But inside main() comes function scope. So i=20. The i
inside the for loop is of block scope and does not affect
the i outside it.

Is This Answer Correct ?    5 Yes 9 No

int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d&quo..

Answer / guest

i=20

Is This Answer Correct ?    2 Yes 10 No

Post New Answer

More C Interview Questions

find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

0 Answers   Microsoft,


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

2 Answers   Cap Gemini, HCL,


Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!

1 Answers  


What is the difference between array and pointer in c?

0 Answers  


What are the primitive data types in c?

0 Answers  






print ur name without using any semicolon in c/c++....

21 Answers   Bosch, TCS, Wipro,


What are external variables in c?

0 Answers  


main() { int i = 10; printf(" %d %d %d \n", ++i, i++, ++i); }

10 Answers   TCS, Vector,


write a progam to compare the string using switch case?

1 Answers  


How can you check to see whether a symbol is defined?

0 Answers  


#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||n++; printf("%d,%d,%d,%d,%d",i,j,k,m,n); }

12 Answers   Capital IQ, Sasken,


What is chain pointer in c?

0 Answers  


Categories