Program to display the different colors using the switch statement.

#include<iostream>
using namespace std;
int main()
{
int a;
cout<<"Enter the value to display the colour\n\n1.Red\n2.Blue\n3.Green\n4.White\n5.Black"<<endl;
cout<<"Enter Your Choice:";
cin>>a;
switch(a)
{
case 1:
cout<<"Colour is Red\n";
break;
case 2:
cout<<"Colour is Blue\n";
break;
case 3:
cout<<"Colour is Green\n";
break;
case 4:
cout<<"Colour is White\n";
break;
case 5:
cout<<"Colour is Black\n";
break;
default:
cout<<"No Result\n";
}
cout<<"/*\nName-Sanjampreet Singh\nRoll Number-1507967\n*/";
}

Output:


Comments

Popular posts from this blog

Program to illustrate the concept of templates.

To create an html file to implement the concept of margin, padding using cascading style sheets.

To configure the IP address for a computer connected to LAN