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
Explain 'bus error'?
Why do we need arrays in c?
How do you define structure?
what is recursion in C
Why can’t constant values be used to define an array’s initial size?
Why header files are used?
What Is The Difference Between Null And Void Pointer?
Explain what is wrong in this statement?
hi any body pls give me company name interview conduct "c" language only
write a program to display all prime numbers
Why do we use pointer to pointer in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
Is c compiled or interpreted?
Why are algorithms important in c program?