Color the output of a program in C

Background Color Menu using SetConsoleTextAttribute for Color the output of a program in C

Text background  in C 

#include<stdio.h>

#include<conio.h>
#include<windowS.h>

int main()

{

printf(“\n\n\t\tTheSmolt-Learn for Free\n\n\n”);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN);

printf(“This is Green Background!”);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE|BACKGROUND_RED| BACKGROUND_INTENSITY);

printf(“\n\n This is Magenta?”);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_INTENSITY|BACKGROUND_RED);

printf(“\n\n This color is Red color)\n”);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_GREEN|BACKGROUND_INTENSITY);

printf(“\n\nThis is mix of two color“);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE|BACKGROUND_GREEN);

printf(““\n\nCombination of Green & Blue);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE|BACKGROUND_RED|BACKGROUND_GREEN);

printf(“\n\nThis is Gray but mix of three color”);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),BACKGROUND_BLUE|BACKGROUND_GREEN| BACKGROUND_INTENSITY);

printf(“\n\nThis is Looks like Radium\n\n\n”);

getch();
return 0;
}

Background color of console output in C and CPP

Color the output of a program in C
Color the output of a program in C

END

C program to draw a square using graphics (clickHere)

Note :- Maybe sometime above code doesn’t get user friendly output, in codeblock ‘or’ any other EDITOR, All of C & C++ program tested in DOS compiler Turbo C.

Also Read

Types of functions in C    Read Here

I hope you will understand better if you study at M.U, in the exam of M.U you know how important this “Color the output of a program in C” . So please don’t forget to give your valuable feedback. Go in the comment section and Give us some feedback about it. Color the output of a program in C or My website.

Our team check your every Comment per day Because your one feedback helps us in growing Thesmolt

Setbkcolor function in c

I request you if you have any doubt or question regarding our site, then please don’t hesitate. We always waiting for your Suggestion.

Note:- If you want to Download This article’s in PDF form, then simply go (Top or Bottom of) Right corner and click on the PRINT icon, and it’s saved as a PDF of C Color the output of a program in C

 

For further questions, you can contact us Via mail [email protected]  otherwise, Our Help Page and Contact us Page, which is included below. I hope I’ll able to say all the possible ways to reach us. Or Download My Android Application Below Download Button.

thesmolt App

Best Regards Color the output of a program in C, Kindly we request to you after Installing This Application, Please Don’t forget to give your feedback.

Note:- In this App, you can read also in Offline mode, When you Open a Post and After save (Right Corner) it.

Cheers Thesmolt

Leave a Reply

x