what is the output of the following code?
main()
{
int I;
I=0x10+010+10;
printf("x=%x",I);
}
give detailed reason

Answer Posted / kartik

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.

Note:The person above me has given the corrst infm however the output is 34.
Try and run the program in C Compiler

Is This Answer Correct ?    12 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c is procedure oriented?

564


What is typedef example?

611


Tell me what are bitwise shift operators?

650


Write a program to check whether a number is prime or not using c?

569


using only #include and #include Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

1304






What is wrong in this statement?

601


What is ambagious result in C? explain with an example.

2049


What is the significance of scope resolution operator?

847


Write a program in c to replace any vowel in a string with z?

683


What is union and structure in c?

606


What is table lookup in c?

622


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

1648


C language questions for civil engineering

1235


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

1718


Which is better pointer or array?

592