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 would be the output of the following prog? Justify
your answer?
main()
{
unsigned char ch;
unsigned char i;
ch = -255;
printf("%d",ch);
i = -1;
printf("%d",i);

}

Answer Posted / bittu

1255

this is because -255 (00000001) when considered unsigned
looks like 1(00000001) in binary and -1(11111111) when
considered unsigned looks like 255(11111111) in binary
(11111111).

refer to this
http://www.allaboutcircuits.com/vol_4/chpt_2/3.html

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

any "C" function by default returns an a) int value b) float value c) char value d) a & b

1133


What is the difference between union and anonymous union?

1373


Is array a primitive data type in c?

1131


Why is python slower than c?

1132


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

1192


What is data type long in c?

1114


Difference between pass by reference and pass by value?

1208


What is a void * in c?

1134


What are the types of functions in c?

1034


Define and explain about ! Operator?

1043


largest Of three Number using without if condition?

1665


Define C in your own Language.

1131


What is .obj file in c?

1129


What is the general form of #line preprocessor?

1039


Can you think of a logic behind the game minesweeper.

2520