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

How would you rename a function in C?

614


How can I remove the leading spaces from a string?

630


What is the use of c language in real life?

527


Tell me what are bitwise shift operators?

654


What is the size of enum in bytes?

581






What is meant by inheritance?

630


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

820


How can a process change an environment variable in its caller?

648


write a program to generate address labels using structures?

4005


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

612


How old is c programming language?

571


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

916


How to declare a variable?

564


What is the purpose of main() function?

648


What do you mean by command line argument?

638