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
Explain how can I make sure that my program is the only one accessing a file?
what is stack , heap ,code segment,and data segment
What is a pointer in c plus plus?
Explain logical errors? Compare with syntax errors.
What is a program flowchart?
What is unsigned int in c?
What is the significance of scope resolution operator?
What is wrong in this statement?
Write the control statements in C language
What is a spanning Tree?
What is wrong with this code?
What are the rules for identifiers in c?
Which node is more powerful and can handle local information processing or graphics processing?
What is difference between %d and %i in c?
How many main () function we can have in a project?