by Dinesh Thakur Category: Control Structures

 

#include<iostream.h>
#include<conio.h>
void main()
{
    int code;
    clrscr();
   cout<<" \n    MAIN MENU ";
   cout<<" \n1. For  Red Color";
   cout<<" \n2. For Green Color";
   cout<<" \n3. For White Color";
   cout<<" \n4. For Yellow Color";
   cout<<"\nEnter the Color Code: ";
   cin>>code;
   switch(code)
         {
               case 1:
                             cout<<"\n Color is RED ";
                             break;
               case 2:
                             cout<<"\n Color is GREEN";
                             break;
               case 3:
                         cout<<"\n Color is WHITE ";
                         break;
               case 4:
                         cout<<"\n Color is YELLOW";
                         break;
               default:
                         cout<<"\n Color does not found";
          }
                         getche();
}

Print The Color According To The Code



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles