Right Click to Search

Wednesday, March 24, 2025

Printf MCQ 21 : sizeof (Float + int)



Printf Multiple Choice Questions 21  : sizeof(Float + int)

Predict the Output of the Following Program if Given Things are - 
#include<stdio.h>
void main()
{
int num1 = 10;
float num2 = 20;
printf("%d",sizeof(num1+num2));
getch();
}
Options :
  1. 2
  2. 4
  3. 30
  4. Garbage

Output :

Switch to Printf MCQ Home :  Click Here

How and Why ?
  1. Integer Can be Converted into Float i.e 20 can be written as 20.0
  2. Here Integer is Converted into Float
  3. Result of num1+num2 is Float
  4. Size of Float is 4 bytes

  Bookmark & Share

Tags / Keywords : |

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates