Tuesday 26 August 2014

What is the Output of the following Program?



#include<stdio.h>
#include<conio.h>
void main( )
{
            int x=10;
            int y=11;
            printf("%x,%d,%i,%x",x,x,x,y);
}

Options:
A)%x,10,10,%x
B)10,10,10,11
C)%x,10,%i,%x
D)a,10,10,b


Answer Option D)
-->%d and %i are used for integer datatype.
-->%x is used for hexadecimal notaion.
Number ---> HexaDecimal Value
   1        --->          1
   2        --->          2
   3        --->          3
   4        --->          4
   5        --->          5
   6        --->          6
   7        --->          7
   8        --->          8
   9        --->          9
   10      --->          a
   11      --->          b
   12      --->          c
   13      --->          d
   14      --->          e
   15      --->          f




0 comments:

Post a Comment