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
Explain low-order bytes.
write a program in c language to print your bio-data on the screen by using functions.
What is d scanf?
Subtract Two Number Without Using Subtraction Operator
What do you mean by keywords in c?
What is ambagious result in C? explain with an example.
What is a memory leak? How to avoid it?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
Are global variables static in c?
Explain the use of 'auto' keyword
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
Explain how can I prevent another program from modifying part of a file that I am modifying?
Explain what math functions are available for integers? For floating point?
Can a local variable be volatile in c?
Write program to remove duplicate in an array?