Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / sharan

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

Here the CATCH is semicolon after for
so maximum positive value for the signed char is 127.
Hence it loops 127 times after that value of i wraps to
negative value that is -128.

Thus it prints -128.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a function simple definition?

1166


How can you convert integers to binary or hexadecimal?

1074


What is an auto keyword in c?

1146


Explain the difference between getch() and getche() in c?

1051


How can I handle floating-point exceptions gracefully?

1242


write a program to rearrange the array such way that all even elements should come first and next come odd

2353


Is a house a mass structure?

1154


Explain how are 16- and 32-bit numbers stored?

1308


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

2218


What is the difference between ā€˜g’ and ā€œgā€ in C?

4093


Explain how can I convert a number to a string?

1207


What is extern variable in c with example?

1056


Explain how can you tell whether two strings are the same?

1077


How would you rename a function in C?

1091


Why do some versions of toupper act strangely if given an upper-case letter?

1115