Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

# Structures, Unions, Enums Questions

NA
SHSTTON
20
Solv. Corr.
49
Solv. In. Corr.
69
Attempted
0 M:0 S
Avg. Time

1 / 43

What is the output of the following 'C' program ?
#include<stdio.h>
int main() {
union {
int a;
int b;
int c;
} u,v;
u.a = 10;
u.b = 20;
printf("%d %d \n",u.a,u.b);
return 0;
}

A20 20

B10 10

C10 20

D20 10

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
50
Solv. Corr.
18
Solv. In. Corr.
68
Attempted
0 M:0 S
Avg. Time

2 / 43

What is the output of the following 'C' problem ?
#include<stdio.h>

struct {
int x;
int y;
union {
int id_no;
char *name;
}b;
}s,*st;
int main()
{
st = &s;
st->x=10;
st->b.id_no = 101;
printf("%d %d\n",s.x,s.b.id_no);
return 0;
}

A10 10

B101 101

C10 101

DNoneof these

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
17
Solv. Corr.
104
Solv. In. Corr.
121
Attempted
0 M:0 S
Avg. Time

3 / 43

What is the output of the following program ?
#include<stdio.h>
void main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s=malloc(sizeof(struct xx));
printf("%d",s->x);
printf("%s",s->name);
}

A3 hello

BGarbage value hello

C3 Garbage Value

DCompiler Error

ENone of these

Explanation:

Initialization should not be done for structure members inside the structure declaration

Workspace

NA
SHSTTON
9
Solv. Corr.
61
Solv. In. Corr.
70
Attempted
0 M:0 S
Avg. Time

4 / 43

What is the output of the following 'C' program ?
#include<stdio.h>
struct myStruct{
int a;
char b;
}*ptr;
int main(){
struct myStruct ms={400,'A'};
printf("%d  %d",ptr->a,ptr->b);
return 0;
}

A400 A

B400 65

C400 97

D0 0

ECompilation error

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
16
Solv. Corr.
32
Solv. In. Corr.
48
Attempted
0 M:0 S
Avg. Time

5 / 43

What is the output of the following 'C' program ?
#include<stdio.h>
typedef struct stu1{
char name1[6];
char name2[6];
double marks;
}STU1;
void main(){
STU1 s1={"rohit","kumar",87.43},*p1;
char *p;
p1=&s1;
p=memchr(p1,'u',sizeof(STU1));
printf("%s",p);
}

Aroh

Brohit

Cumar

Drohit kumar

ECompilation error

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
30
Solv. Corr.
18
Solv. In. Corr.
48
Attempted
0 M:0 S
Avg. Time

6 / 43

What is the output of the following 'C' program?
#include<stdio.h>
void main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}

A3 hello

BGarbage Value

CCompilation error

DNone of these

Explanation:

You should not initialize variables in declaration

Workspace

NA
SHSTTON
49
Solv. Corr.
46
Solv. In. Corr.
95
Attempted
0 M:0 S
Avg. Time

7 / 43

What is the output of the following 'C' program?
#include<stdio.h>
void main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
}

ANo Error

BCompiler Error

CNone of these

Explanation:

The structure yy is nested within structure xx.
Hence, the elements are of yy are to be accessed through the instance of structure xx, which needs an instance of yy to be known.
If the instance is created after defining the structure the compiler will not know about the instance relative to xx. Hence for nested structure yy you have to declare member.

Workspace

NA
SHSTTON
5
Solv. Corr.
45
Solv. In. Corr.
50
Attempted
0 M:0 S
Avg. Time

8 / 43

What is the output of the following 'C' program?
#include<stdio.h>
enum colors {BLACK,BLUE,GREEN,YELLOW};
int main()
{
printf("%d..%d..%d..%d",BLACK,BLUE,GREEN,YELLOW);
return 0;
}

A0..2..3..4

B0..2..2..3

C0..1..2..3

DNone of these

Explanation:

enum assigns numbers starting from 0, if not explicitly defined.

Workspace

NA
SHSTTON
24
Solv. Corr.
23
Solv. In. Corr.
47
Attempted
0 M:0 S
Avg. Time

9 / 43

What is the output of the following 'C' program?
#include<stdio.h>
enum colors {BLACK,BLUE=2,GREEN,YELLOW};
int main()
{
printf("%d..%d..%d..%d",BLACK,BLUE,GREEN,YELLOW);
return 0;
}

A0..2..3..4

B0..2..2..3

C0..1..2..3

DNone of these

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
71
Solv. Corr.
25
Solv. In. Corr.
96
Attempted
0 M:0 S
Avg. Time

10 / 43

What is the output of the following 'C' program?
#include<stdio.h>
enum colors {BLACK,BLUE=-2,GREEN,YELLOW};
int main()
{
printf("%d..%d..%d..%d",BLACK,BLUE,GREEN,YELLOW);
return 0;
}

A0..2..3..4

B0..-2..-1..0

C0..1..2..3

D0..-2..1..2

Explanation:

Here is no explanation for this answer

Workspace

## C Programming Structures, Unions, Enums Questions and Answers pdf

At C Programming topic Structures, Unions, Enums, you will get multiple online quiz difficulty wise, which will have a total of 6 quizzes, categorized as easy, medium, and moderate level. While preparing for any Structures, Unions, Enums, take all the list quiz and check your preparation level for that topic. Each quiz have 10 different question, which needs to be answered in 20 min., all the listed quiz here is free, however, you will get only one chance for each quiz to attempt(Take Quiz seriously), so it is always recommended to take one quiz in each section before you start solving Structures, Unions, Enums MCQs practice question, and one after solving all the question of the respective level, you can refer back your Structures, Unions, Enums quiz result any time or you can download it as pdf for reference.

## C Programming Structures, Unions, Enums Customize Online Mock Test

This is own type of mock test, where At this C Programming Structures, Unions, Enums MCQs mock test section, you will able to attempt only the questions related to Structures, Unions, Enums, in that question will be a different level, important, and all the questions will be part of some of the mock tests across Q4interview FREE Mock test. You need to choose the topic as Structures, Unions, Enums, and click on Double click to generate your customize mock test. While attempting the mock test you need to choose any of the one options out of given option. It is recommended to go through the direction given along with each question, as these questions will be randomly and so that same direction will not be applicable across the entire test. Once you submit your mock test, the result will be generated for Structures, Unions, Enums Customize mock test, where your performance point points will be highlighted. Q4interview analysis every single point which helps you to improve your topic understanding and help you to know your type of mistakes and way to improve Structures, Unions, Enums questions, by providing the same type of practice questions from practice exercise. The best part of this Structures, Unions, Enums, all these mock tests listed here are free and you can take as Many time, as many you want. When you continue to give Structures, Unions, Enums Customize Online Mock Test here regularly, then you will understand how much you have developed your accuracy on a topic, after that you will be able to decide how much attention you need to focus on. Your continued practice will increase your confidence, speed and thinking ability intensely, the Structures, Unions, Enums Customize topic on which you will practice more will beneficial for you in future during campus placement.

## C Programming Structures, Unions, Enums Quiz Online Test

The details of the C Programming Structures, Unions, Enums quiz are as follows. There are 10 questions for you. You have to answer them in 20 minutes. Within 20 minutes you have to see the errors in the sentences given as a question. Four options are also given to you, and you have to choose your opinion. You must be confident in your answer that the choices are difficult. Therefore, below we provide you with some information about C Programming Structures, Unions, Enums that you see and keep them in mind while answering questions.

## C Programming Structures, Unions, Enums MCQs Practice Questions with Answer

On this Structures, Unions, Enums section of page you will find the easiest quickest ways to solve a question, formulas, shortcuts and tips and tricks to solve various easiest methods to solve Structures, Unions, Enums Question Quickly. It contains all the C Programming topic Structures, Unions, Enums questions which are common in any of the preliminary exams of any company. The solution is provided along with the questions. The practice of these questions is a must as they are easy as well as scoring and asked in all the exams They will confirm the selection if all the questions attempted wisely with little practice. It is recommanded to Take Mock test based on C Programming topic and Structures, Unions, Enums topic based quiz.

## C Programming Structures, Unions, Enums solved examples question

You can get here fully solved Structures, Unions, Enums examples with a detailed answer and description. You can solve Structures, Unions, Enums problems with solutions, the questions by companies wise by filtering the questions, additionally, you can check what type of questions are being asked in IT companies Written Round from Structures, Unions, Enums. Structures, Unions, Enums became one of the most important sections in the entire competitive exams, Companies Campus, and entrance online test. Go through Structures, Unions, Enums Examples, Structures, Unions, Enums sample questions. You can Evaluate your level of preparation in Structures, Unions, Enums by Taking the Q4Interivew Structures, Unions, Enums Online Mock Test based on most important questions. All the Structures, Unions, Enums practice questions given here along with answers and explanations are absolutely free, you can take any number of time any mock Test.

## Why C Programming Structures, Unions, Enums?

In this practice section, you can practice C Programming Questions based on "Structures, Unions, Enums" and improve your skills in order to face the interview, competitive examination, IT companies Written exam, and various other entrance tests (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

## Where can I get C Programming Structures, Unions, Enums questions and answers with explanation?

Q4Interview provides you lots of fully solved C Programming (Structures, Unions, Enums) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. You can download C Programming Structures, Unions, Enums quiz questions with answers as PDF files and eBooks.

## Where can I get C Programming Structures, Unions, Enums Interview Questions and Answers (objective type, multiple-choice, quiz, solved examples)?

Here you can find objective type C Programming Structures, Unions, Enums questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.