What is the output of the program given below

#include<stdio.h>
main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}

Answer Posted / akash dhal

initialized with 0
in for loop ist time condition satisfied so print 0,like
this 127 will be printed .as it is a signed no. so 127+1 is
-128 so condition false come out of the loop.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are near, far and huge pointers?

642


What are valid signatures for the Main function?

697


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1244


Explain is it better to bitshift a value than to multiply by 2?

708


What are external variables in c?

540






When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1527


What is function pointer c?

581


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

1648


Write a code of a general series where the next element is the sum of last k terms.

589


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

658


Explain zero based addressing.

601


What is the auto keyword good for?

616


Under what circumstances does a name clash occur?

684


What is the use of linkage in c language?

611


How can you restore a redirected standard stream?

606