To enter the character and Formatted output in colors + blink

Write a program to enter the character and Formatted output in colors + blink using switch case statement.


Source Code:

#include<stdio.h>
#include<conio.h>
void main()
{
	char ch;
	clrscr();
	printf("Enter the character:");
	scanf("%c",&ch);

	switch(ch)
	{
		case 'r':
			textcolor(RED+128);
			cprintf("red");
			break;
		case 'y':
			textcolor(YELLOW+128);
			cprintf("yellow");
			break;
		case 'g':
			textcolor(GREEN+128);
			cprintf("green");
			break;

	}
	getch();
}

Output:

Enter the character: r
RED

Leave a Reply

Your email address will not be published. Required fields are marked *