Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to change output color with system("color")

+10 votes
asked Oct 25, 2023 by Pessoua (500 points)
I have tried to change output color with system("color a1"); but it says color not found, help me out?

1 Answer

+2 votes
answered Oct 25, 2023 by Peter Minarik (89,130 points)
edited Oct 26, 2023 by Peter Minarik

It is because color is a Windows command and OnlineGBD is running on a Linux server.

Look at tput setaf and tput setab in this article. The color codes can be found here.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.