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
What is meant by realloc()?
What is operator promotion?
what is the diffrenet bettwen HTTP and internet protocol
Why is not a pointer null after calling free?
What are the two forms of #include directive?
What is a rvalue?
What is wrong with this program statement? void = 10;
What are the different types of linkage exist in c?
What is extern c used for?
What do the functions atoi(), itoa() and gcvt() do?
How many data structures are there in c?
What is meant by type specifiers?
What will the preprocessor do for a program?
Add Two Numbers Without Using the Addition Operator
Which header file is essential for using strcmp function?