Login and Register ×
Check your Email for the OTP
#include #include void main() { union Data{ int i; unsigned char c; }data; data.c = 'C'; data.i = 89; printf("%c\n", data.c); }
#include int main() { struct emp { char *n; int age; }; struct emp e1 = {"Dravid", 23}; struct emp e2 = e1; strupr(e2.n); printf("%s\n", e1.n); return 0; }
#include int main() { struct node { int data; struct node *link; }; struct node *p, *q; p = (struct node *) malloc(sizeof(struct node)); q = (struct node *) malloc(sizeof(struct node)); printf("%d, %d\n", sizeof(p), sizeof(q)); return 0; }
#include "stdio.h" union { int ival; float fval; } u; void main() { printf("%d", sizeof(u)); }
#include union { int x; char y; }p; int main() { p.y = 60; printf("%d\n", sizeof(p)); }
#include union utemp { int a; double b; char c; }u; int main() { u.c = 'A'; u.a = 1; printf("%d", sizeof(u)); }
#include struct course { int courseno; char coursename[25]; }; int main() { struct course c[] = { {102, "Java"}, {103, "PHP"}, {104, "DotNet"} }; printf("%d ", c[1].courseno); printf("%s\n", (*(c+2)).coursename); return 0; }
#include union p { int x; float y; }; int main() { union p p, b; p.x = 10; printf("%f\n", p.y); }
#include int main() { enum status {pass, fail, absent}; enum status stud1, stud2, stud3; stud1 = pass; stud2 = absent; stud3 = fail; printf("%d %d %d\n", stud1, stud2, stud3); return 0; }