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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a code on reverse string and its complexity.

624


Why c is procedure oriented?

586


Is c programming hard?

588


What are the back slash character constants or escape sequence charactersavailable in c?

704


What is the difference between struct and union in C?

586






Is c easier than java?

589


Which header file is essential for using strcmp function?

956


What are runtime error?

651


The statement, int(*x[]) () what does in indicate?

665


what are non standard function in c

1454


Write a program to use switch statement.

671


Why we use stdio h in c?

602


Why is c fast?

622


what is stack , heap ,code segment,and data segment

2233


Explain how can I manipulate strings of multibyte characters?

794