int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10
i++;
}
printf("%d", i);
Answers were Sorted based on User's Feedback
Answer / jai
printf() will never be executed since for() is an infinite
loop.
| Is This Answer Correct ? | 30 Yes | 2 No |
Answer / vignesh1988i
it will not print i value at all , since the loop is always
true for all cases. since the termination condition is
depending upon n&i,always n<=i, what ever possibe positive
value greater than zero ,it may be.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / dips
it doesnt have any terminating condition so it will be
infinite loop ,no output
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
what defference between c and c++ ?
What is the use of bitwise operator?
What is encapsulation?
How the C program can be compiled?
Write a program that takes three variables(a,b,c) in as separate parameters and rotates the values stored so that value a goes to b,b,to c and c to a
How to add two numbers with using function?
Explain the differences between public, protected, private and internal.
what is compiler
WHAT IS HEADER?
What is a good data structure to use for storing lines of text?
int main() { int days; printf("enter days you are late"); scanf("%d",days); if (days<=5) printf("5o paisa fine"); if (days<=10&&days>=6) printf("1rs fine"); if(days>10) printf("10 rs fine"); if(days=30) printf("membership cancelled"); return 0; } tell me whats wrong in this program? is it right?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon