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

hi any body pls give me company name interview conduct "c" language only

1667


What is call by value in c?

558


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

579


What are the different properties of variable number of arguments?

668


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1888






What is the use of pragma in embedded c?

592


Can an array be an Ivalue?

666


Explain what math functions are available for integers? For floating point?

614


What are derived data types in c?

611


Write a program to find the biggest number of three numbers in c?

588


how to find binary of number?

3439


Difference between strcpy() and memcpy() function?

676


what is the function of pragma directive in c?

626


How do you define a string?

655


Why does the call char scanf work?

620