Using Swich-case


#include<iostream.h>
#include<conio.h>

void main()
{
    int no;
    clrscr();

    cout<<"Enter a number:";
    cin>>no;

    switch(no)
    {
        case 1:
            cout<<"You got 1st class";
            break;
        case 2:
            cout<<"You got 2nd class";
            break;
        case 3:
            cout<<"You got Pass class";
            break;
        default:
            cout<<"Such number is not available";
            break;
    }
}
Previous Post Next Post