Class roll number program

in programming •  7 years ago  (edited)

Program Body

#include <iostream>

using namespace std;

void display();

int main(){

    cout<<"welcome to this G.H.S no#3 school"<<endl;

    cout<<"press 1 to go to class 9th blue"<<endl;

    cout<<"press 2 to get into class 9th pink"<<endl;

    int a,c,e,d;

    cin>>a;

    switch (a){

case 1:{

    cout<<"you entered in 9th blue class"<<endl;

  int b[2][2]{

        {

            11,30

        },

        {

           85,97

        }

    };

    cout<<"enter the roll no of students there are only 2 of them"<<endl;

    cin>>c;

    if(c==1){

        cout<<b[0][0]<<" "<<b[0][1]<<endl;

    }else if(c==2){

    cout<<b[1][0]<<" "<<b[1][1]<<endl;


    }break;}

  case 2:{

    int d;

        cout<<"you entered in 9th pink class"<<endl;

  int e[2][2]={

        {

            100,99

        },

        {

           23,01

        }

    };

    cout<<"enter the roll no of students there are only 2 of them"<<endl;

    cin>>d;

    if(d==1){

        cout<<e[0][0]<<" "<<e[0][1]<<endl;

    }else if(d==2){

    cout<<e[1][0]<<" "<<e[1][1]<<endl;

    }

    }

    }

display();

}

void display (){

    cout<<"visit new places.there are ten of them"<<endl;

   int f=10;

    cout<<f<<endl;

}

I hope you guys liked it

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!