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

What is the relationship between pointers and data structure?

0 Answers  


Is there any data type in c with variable size?

0 Answers  


Can we write a program without main() function?

9 Answers  


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

0 Answers  


how to execute with out main in cprogram

15 Answers   Infosys,






c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

0 Answers  


What is a floating point in c?

0 Answers  


helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.

3 Answers  


What are the 4 data types?

0 Answers  


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

0 Answers   TCS,


write a code for large nos multilication (upto 200 digits)

2 Answers   Persistent,


What does stand for?

0 Answers  


Categories