Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

C Programming :: Variables & Data Types

5. What will be output of the following "c" code?

#include
int main(){
float x;
x=(int)5.6f*3.2f/sizeof((int)6.6);
printf("%f",x);
return 0;
}

Answer: Option C

Explanation :

Variable x is initially declared as float.

In line 4-

x=(int)5.6f*3.2f/sizeof((int)6.6);

or, x=(int)5.6f*3.2f/sizeof(6);        [Since, we are typecasting 6.6 to int]

or, x=(int)5.6f*3.2f/4;                    [Since, 6 is integer type, and size of int is 4 bytes]

or, x=(int)4.48;

or, x=4;                                         [Since, 4.48 is typecasted to int]

In line 5, we are converting int x=4 to float type and we are printing it.

Hence, the output is 4.000000.

Post Your Answer Here:     

Reply     |    Rate This: +0 -0      |     Report     |     To Reading List



Report Error

Please Login First Click Here