Feedback for subjective question

Report on solved past papers subjective question
Question 1: Write down the output of the code given below:
Hint: Size of char is 1 byte, Size of int is 2 byte, Size of float is 4 byte
#include <iostream.h>
union mytypes_t {
char c;
int i;
float f;
} mytypes;
int main(){
mytypes.c = 'H';
mytypes.i = 15;
cout << sizeof(mytypes)<<endl;
mytypes.i = 15;
mytypes.c = 'H';
cout << sizeof(mytypes)<<endl;
system("PAUSE");
return 0;
}

Please login to submit feedback on subjective question.

Login Now

Account Related


Earnings Related


Funds Related


Live Related


Sponsored

Theme Customizer

Gaussian Texture



Gradient Background