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 following code?
main()
{
int I;
I=0x10+010+10;
printf("x=%x",I);
}
give detailed reason

Answer Posted / yogesh bansal

Output of this program is 22
reason is :
0x10 is hexadecimal value which is equal to 16 in decimal.
010 is octal value which is equal to 8 in decimal
10 is decimal value

so total is 16+8+10= 34

I value is 34.
Now we are printing the value of I on hexadecimal using %x
34 is equal to 0x22 in hexadecimal.

so the output is 22 in hexadecimal

Hope its is clear to you

Is This Answer Correct ?    70 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are operators in c?

1034


How are variables declared in c?

1110


What is huge pointer in c?

1097


What is a global variable in c?

1022


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

1069


Once I have used freopen, how can I get the original stdout (or stdin) back?

1080


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

1382


Explain 'bus error'?

1106


What is scanf_s in c?

1129


What is wild pointer in c with example?

1069


Explain modulus operator.

1065


Write program to remove duplicate in an array?

1090


What is include directive in c?

1169


How does #define work?

1086


When can you use a pointer with a function?

1087