C++ Program to change Foreground Colour of Console Screen(Windows) [DEVCPP/GCC]

PROGRAM

//Program to change Foreground Colour of Console Screen (Windows)

#include <iostream>

using namespace std;

int main()
{
int choice;

cout<<"ENTER NUMBER(0-8): ";
cin>>choice;

switch(choice)
{
case 1: //Blue
system("COLOR 1");
break;

case 2: //Green
system("COLOR 2");
break;

case 3: //Aqua
system("COLOR 3");
break;

case 4: //Red
system("COLOR 4");
break;

case 5: //Purple
system("COLOR 5");
break;

case 6: //Yellow
system("COLOR 6");
break;

default:
cout<<"WRONG CHOICE";

}

cout<<"\n\t\t\tHAPPY HOLI";
return 0;
}

OUTPUT


Share this

Related Posts

FIND US ON FACEBOOK!