Monday 11 March 2013

sizeof()


    #include<stdio.h>
    int main()
{
    printf("%d\t",sizeof(6.5));
    printf("%d\t",sizeof(90000));
    printf("%d",sizeof('A'));
    return 0;
}
Output: 8         4          1

Explanation: 

6.5 is of double type by default, to make it float, it must be written as 6.5f. 
90000 is of long type by default.
'A' is a char type. 


Blog Author: Vijay Kumar

Go to: Java Aptitude

No comments:

Post a Comment