Quiz on Enumeration

Check your understanding of enumeration by completing this quiz.

1

What will be the output of the following program:

# include <stdio.h> 
int main( )
{
enum grade { Agrade, Bgrade, Cgrade } ;
enum grade  stud1, stud2, stud3 ;
stud1 = Agrade ;
stud2 = Bgrade ;
stud3 = Cgrade;
printf ( "%d %d %d\n", stud1, stud2, stud3 ) ;
return 0 ;
}
A)

0 1 2

B)

Agrade Bgrade Cgrade

C)

Error: Cannot print enum elements using %d

Question 1 of 50 attempted

Get hands-on with 1200+ tech skills courses.