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
What are the advantages of external class?
What is the purpose of & in scanf?
Can we declare variable anywhere in c?
What is the difference between volatile and const volatile?
Apart from dennis ritchie who the other person who contributed in design of c language.
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What is structure padding and packing in c?
Explain what math functions are available for integers? For floating point?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What is line in c preprocessor?
What does the error message "DGROUP exceeds 64K" mean?
writ a program to compare using strcmp VIVA and viva with its output.
Is c compiled or interpreted?
Explain bit masking in c?
Can I initialize unions?