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
How can a string be converted to a number?
What are runtime error?
Is array a primitive data type in c?
What are the different types of constants?
What are the functions to open and close the file in c language?
What is the use of bit field?
Can you please explain the scope of static variables?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What are local static variables?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
Explain how do you use a pointer to a function?
What is function prototype in c with example?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
What is c language used for?
What is the difference between volatile and const volatile?