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

cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1055


How many keywords (reserve words) are in c?

1083


What are the three constants used in c?

930


Explain how can I convert a number to a string?

1100


What is main function in c?

1015


What is the use of structure padding in c?

1014


What is pointer to pointer in c language?

1049


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

2064


Explain how do you declare an array that will hold more than 64kb of data?

1398


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

990


What does the function toupper() do?

1065


What is substring in c?

1132


Is it fine to write void main () or main () in c?

964


Can true be a variable name in c?

986


can we change the default calling convention in c if yes than how.........?

2471