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 the 10 different models of writing an addition program in C language?

1866


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2611


What is %lu in c?

1203


Explain how do you search data in a data file using random access method?

1085


What is the purpose of the preprocessor directive error?

1219


what is the difference between 123 and 0123 in c?

1169


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

988


Are there any problems with performing mathematical operations on different variable types?

1015


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1037


How can you find the exact size of a data type in c?

976


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1042


What is the use of c language in real life?

995


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2257


What is c standard library?

1166


What is the function of multilevel pointer in c?

1044