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 the colour of a text in c++progrma

+2 votes
asked Aug 5, 2024 by Joy Mutinda (140 points)

1 Answer

0 votes
answered Aug 15, 2024 by Peter Minarik (101,340 points)
If you're using standard output, then it depends on the shell (and the operating system).

Read this for Unix-based systems: https://stackoverflow.com/questions/6841143/how-to-set-font-color-for-stdout-and-stderr

Read this for Windows-based systems: https://stackoverflow.com/questions/4920661/setting-stdout-stderr-text-color-in-windows

If you're using a windowing system, there is probably a Color property or similar.

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