From 846bc800858bcf961affd842691bb78e468fbbc9 Mon Sep 17 00:00:00 2001 From: Pavitra Sharma <96616718+pavitrasharma2101@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:41:20 +0530 Subject: [PATCH] Create program to Change the Text Background Color.c --- ...gram to Change the Text Background Color.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 C/program to Change the Text Background Color.c diff --git a/C/program to Change the Text Background Color.c b/C/program to Change the Text Background Color.c new file mode 100644 index 0000000..cc7e677 --- /dev/null +++ b/C/program to Change the Text Background Color.c @@ -0,0 +1,29 @@ +#include +#include + +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; +}