using functions to change the console color in printf c

Solutions on MaxInterview for using functions to change the console color in printf c by the best coders in the world

showing results for - "using functions to change the console color in printf c"
Léonie
11 Mar 2018
1#include <stdio.h>
2void red () {
3  printf("\033[1;31m");
4}
5
6void yellow {
7  printf("\033[1;33m");
8}
9
10void reset () {
11  printf("\033[0m");
12}
13
14int main () {
15  red();
16  printf("Hello ");
17  yellow();
18  printf("world\n");
19  reset();
20  return 0;
21}