enum in c

enum in c

University

10 Qs

quiz-placeholder

Similar activities

some questions

some questions

11th Grade - University

8 Qs

Unit 3 C Pro P1

Unit 3 C Pro P1

University

8 Qs

ROUND 2

ROUND 2

University

10 Qs

Macro and Macro preprocessor

Macro and Macro preprocessor

University

10 Qs

Skill Development - Debugging Practice1

Skill Development - Debugging Practice1

10th Grade - Professional Development

10 Qs

Cơ sở lập trình_chương 4

Cơ sở lập trình_chương 4

University

15 Qs

IPC144 SLG -- Week2

IPC144 SLG -- Week2

University

9 Qs

Valedictory

Valedictory

University

7 Qs

enum in c

enum in c

Assessment

Quiz

Computers

University

Hard

Created by

Satheesh D

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following C code?

main()

{ enum result

{pass, fail};

enum result s1,s2;

s1=pass; s2=fail;

printf("%d",s1); }

error

pass

fail

0

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

enum example {a = 1, b, c};

enum example example1 = 2;

enum example answer()

{ return example1; }  

int main()

{

(answer() == a)? printf("yes"): printf("no"); return 0; }

yes

no

2

error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include<stdio.h>

#define MAX 4

enum s1 { a,b=3,c };

main()

{ if(MAX!=c)

printtf("hello");

else printf("welcome"); }

error

hello

welcome

2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Arithmetic operations such as addition, subtraction, multiplication and division are allowed on enumerated constants.

true

false

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include<stdio.h>

enum sum

{

a=1,b,c,d,e

};

int main()

{ printf("%d",b*c+e-d); }

error

7

2

4

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include<stdio.h>

enum test

{ a,b,c=5 };

int main()

{ enum test s;

b=10;

printf("%d",b); }

error

10

1

4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

All of them let you define new values

All of them let you define new data types

All of them let you define new pointers

All of them let you define new structures

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?