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

What is volatile variable how do you declare it?

566


What is function and its example?

628


Is swift based on c?

640


Why calloc is better than malloc?

572


What is wrong with this statement? Myname = 'robin';

822






What is the use of function in c?

715


Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)

610


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

649


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2226


How many types of operators are there in c?

619


Where is c used?

652


what do you mean by inline function in C?

618


Can we replace the struct function in tree syntax with a union?

782


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

643


provide an example of the Group by clause, when would you use this clause

1709