for(i=1;i>0;i++);
printf("i=%d",i);
what will be the answer????
Answer Posted / guest
The value of i starts at 1 and increments from there. The
loop terminates when i <= 0.
For an unsigned value, this is only possible when i == 0.
For a signed value, incrementing a positive value by 1 will
eventually overflow within the binary word to become the
most negative value an integer can hold. The sequence is
thus (..., INT_MAX-1, INT_MAX, INT_MIN) and the loop
terminates, where INT_MAX and INT_MIN are the "most
positive" and "most negative" values for the word size used
on your machine.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How can a program be made to print the name of a source file where an error occurs?
What is static and volatile in c?
How do you define a string?
How do I create a directory? How do I remove a directory (and its contents)?
What is string function in c?
What are header files why are they important?
What is scope and lifetime of a variable in c?
What is I ++ in c programming?
Why do we use stdio h and conio h?
#include
Which are low level languages?
How to declare a variable?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
How to declare pointer variables?
write a program to create a sparse matrix using dynamic memory allocation.