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 10 different models of writing an addition program in C language?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What is %lu in c?
Explain how do you search data in a data file using random access method?
What is the purpose of the preprocessor directive error?
what is the difference between 123 and 0123 in c?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Are there any problems with performing mathematical operations on different variable types?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
How can you find the exact size of a data type in c?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What is the use of c language in real life?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
What is c standard library?
What is the function of multilevel pointer in c?