What is the similarity between a structure, union and enumeration?

Home | Discussion Forum
Taiyari24Hour

What is the similarity between a structure, union and enumeration?



View More Related Question

2) What is the output of this C code(according to C99 standard)?

#include <stdio.h>
struct p {
int k;
char c;
float f;
};
int main()
{
struct p x = {.c = 97};
printf("%f\n", x.f);
}

3) Can the below code be compiled successfully?

#include <stdio.h>
struct p {
int k;
char c;
float f;
};
int main()
{
struct p x = {.c = 97, .f = 3, .k = 1};
printf("%f\n", x.f);
}

4) What is the output of this C code?

#include <stdio.h>
void main()
{
struct student {
int no;
char name[20];
};
struct student s;
no = 8;
printf("%d", no);
}

5) What is the output of this C code?

#include <stdio.hgt;
void main()
{
struct student {
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%d", s.no);
}

UP Gk Online Test

taiyari24hour.com

Study 2 Online Says....
Kindly log in or signup.