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


Please Help Members By Posting Answers For Below Questions

Explain how can I make sure that my program is the only one accessing a file?

611


what is stack , heap ,code segment,and data segment

2208


What is a pointer in c plus plus?

681


Explain logical errors? Compare with syntax errors.

615


What is a program flowchart?

591






What is unsigned int in c?

546


What is the significance of scope resolution operator?

845


What is wrong in this statement?

595


Write the control statements in C language

637


What is a spanning Tree?

935


What is wrong with this code?

683


What are the rules for identifiers in c?

579


Which node is more powerful and can handle local information processing or graphics processing?

811


What is difference between %d and %i in c?

678


How many main () function we can have in a project?

602