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

What is spark map function?

585


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2339


How does placing some code lines between the comment symbol help in debugging the code?

550


What is the difference between #include and #include 'file' ?

610


How can I insert or delete a line (or record) in the middle of a file?

579






Why double pointer is used in c?

573


What does %d do in c?

550


How can my program discover the complete pathname to the executable from which it was invoked?

665


Is int a keyword in c?

561


What is merge sort in c?

649


Which driver is a pure java driver

996


What does nil mean in c?

676


What is structure in c language?

627


Subtract Two Number Without Using Subtraction Operator

360


Write a code to generate divisors of an integer?

645