It’s wonderful to print colorful strings on your terminal and here we show you how to do that.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include <stdio.h>

int main() {
    char ss[1024] = {"Colorful!!!"};
    printf("\033[0;31m %s \033[0;39m\n", ss);  // red
    printf("\033[0;32m %s \033[0;39m\n", ss);  // green
    printf("\033[0;33m %s \033[0;39m\n", ss);  // yellow
    printf("\033[0;34m %s \033[0;39m\n", ss);  // blue
    printf("\033[0;35m %s \033[0;39m\n", ss);  // purple
    return 0;
}