C to accept a grade and declare the equivalent description Grade Description



Write a program in C to accept a grade and declare the equivalent description   

Grade Description 

E Excellent 

V Very Good 

G Good 

A Average 

F Fail 



#include <stdio.h> 
#include <conio.h> 
void main() 
    char a;  
    printf("enter a character: "); 
    scanf("%c", &a); 
    switch(a
    { 
        case 'E'
        printf("Excellent!"); 
        break
        case 'V'
        printf("Very Good!"); 
        break
        case 'G':
        printf("Good!"); 
        break
        case 'A'
        printf("Average!"); 
        break
        case 'F'
        printf("Fail!"); 
        break
    default
    printf("enter your correct grade!"); 
    } 
    getch(); 


OUTPUT

Enter a character: A

Average!


Follow our page for regular updates.

0 Comments