#include<stdio.h> output: 1 2 3 4 5 ... 127 -128 -127... -2 -1 plz explain how this output came because there is no condn for termination of loop
int main()
{
char i=0;
for(i<=5&&i>= -1;++i;i>0)
printf("%d ",i);
printf("\n");
return 0;
}
#include<stdio.h>
int main() {
char i=0;
//for(i<=5&&i>= -1;++i;i>0)
// printf("%d ",i); // can be transformed to:
i<=5&&i>= -1; // FALSE but does nothing
while (++i){ // beginning 0 gets set to 1,2,3, 127, -128 etc (8bit signed number)
printf("%d ",i); i>0; //True or false, does nothing
} //Ends after -128 because the next number is 0 which is FALSE in C and this ends the loop
printf("\n");
return 0; }