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 volatile c?
largest Of three Number using without if condition?
What are lookup tables in c?
In C language what is a 'dangling pointer'?
What is a far pointer in c?
What is a nested loop?
Explain the ternary tree?
what is the format specifier for printing a pointer value?
What is table lookup in c?
What is a ternary operator in c?
which type of aspect you want from the student.
What is a double c?
difference between Low, Middle, High Level languages in c ?
List the different types of c tokens?
What are directives in c?