forked from Sniper7sumit/Hacktoberfest2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Change the Text Background Color
29 lines (21 loc) · 1.19 KB
/
Change the Text Background Color
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<windows.h>
#include<stdio.h>
int main()
{
printf("\n\n\t\tStudytonight - Best place to learn\n\n\n");
//BACKGROUND_RED| BACKGROUND_GREEN| BACKGROUND_BLUE| BACKGROUND_INTENSITY
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE|BACKGROUND_RED|BACKGROUND_INTENSITY);
printf("\n\nStudytonight just showed you how to put colors to your code!!");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN);
printf("\n\nIsn't this Awesome?");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_RED);
printf("\n\nYou just did something that only 1 out of 10 coders are familiar of :)\n");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN|BACKGROUND_INTENSITY);
printf("\n\nYou are doing great!!");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE|BACKGROUND_INTENSITY);
printf("\n\nThe best is yet to come!");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN|BACKGROUND_INTENSITY);
printf("\n\nWhat are you waiting for?? Just play with it!!");
printf("\n\n\t\t\tCoding is Fun !\n\n\n");
return 0;
}