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 / prasanna kumar [cse dept. kln

i think the program will give the output as 0 or null....
because i=0 is in int datatype but in this program it is
declared as character datatype so it will give the output as
0 or null and it will goes for only one time after wards it
will incremented and goes infinitely....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does main () mean in c?

862


Write a program to print fibonacci series without using recursion?

844


How is a structure member accessed?

817


Is main an identifier in c?

843


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

2848


Why does this code crash?

839


What is a shell structure examples?

807


What is variable initialization and why is it important?

842


Write a program to show the change in position of a cursor using c

828


How can a program be made to print the line number where an error occurs?

878


What type of function is main ()?

810


Is it better to bitshift a value than to multiply by 2?

864


State the difference between x3 and x[3].

841


What is c definition?

962


What is a pointer variable in c language?

843