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

Answers were Sorted based on User's Feedback



what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x"..

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

what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x"..

Answer / kartik

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.

Note:The person above me has given the corrst infm however the output is 34.
Try and run the program in C Compiler

Is This Answer Correct ?    12 Yes 7 No

what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x"..

Answer / arpita

12

Is This Answer Correct ?    2 Yes 29 No

Post New Answer

More C Interview Questions

WHAT IS PRE POSSESSORS?

6 Answers   TATA,


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

0 Answers  


Subtract Two Number Without Using Subtraction Operator

0 Answers  


What are pointers in C?

5 Answers   KPIT,


What is maximum size of array in c?

0 Answers  


Tell me when is a void pointer used?

0 Answers  


What are the different properties of variable number of arguments?

0 Answers  


Are the outer parentheses in return statements really optional?

0 Answers  


Explain how can you restore a redirected standard stream?

0 Answers  


How do I round numbers?

0 Answers  


which is an algorithm for sorting in a growing Lexicographic order

0 Answers  


Define C in your own Language.

0 Answers   Motorola,


Categories