Change the color of the text

+3 votes
asked Apr 23 by Mariana3299 (150 points)
How do you change the color of the text?

4 Answers

+1 vote
answered Apr 23 by Jerson Dayuday (160 points)
<h1 Style = "color :white">Hello World!</h1>
commented Apr 24 by Ashrith Annamreddy (350 points)
That's for html. You need to specify what coding language you want to change the color of the text in
0 votes
answered Apr 23 by QuiiKy _ (420 points)
In short:

you can't change colors of text on this compiler.
0 votes
answered Apr 24 by partheshsingh (150 points)
depends upon the programming language you are coding on.
0 votes
answered Apr 26 by LiOS (5,120 points)
Depends on the language and there are many different methods. Colour can be changed in this compiler.

One method in C:

#include <stdio.h>

int main () {
    
    printf("\033[1;31m");   // set colour to red
    printf("Hello world\n");
    printf("\033[0m"); // set colour to white
 
    return 0;
}
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.
...