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
Write a code on reverse string and its complexity.
Why c is procedure oriented?
Is c programming hard?
What are the back slash character constants or escape sequence charactersavailable in c?
What is the difference between struct and union in C?
Is c easier than java?
Which header file is essential for using strcmp function?
What are runtime error?
The statement, int(*x[]) () what does in indicate?
what are non standard function in c
Write a program to use switch statement.
Why we use stdio h in c?
Why is c fast?
what is stack , heap ,code segment,and data segment
Explain how can I manipulate strings of multibyte characters?