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
hi any body pls give me company name interview conduct "c" language only
What is call by value in c?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What are the different properties of variable number of arguments?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the use of pragma in embedded c?
Can an array be an Ivalue?
Explain what math functions are available for integers? For floating point?
What are derived data types in c?
Write a program to find the biggest number of three numbers in c?
how to find binary of number?
Difference between strcpy() and memcpy() function?
what is the function of pragma directive in c?
How do you define a string?
Why does the call char scanf work?