Answers for "using functions to change the console color in printf C"

C
0

using functions to change the console color in printf C

#include <stdio.h>
void red () {
  printf("\033[1;31m");
}

void yellow {
  printf("\033[1;33m");
}

void reset () {
  printf("\033[0m");
}

int main () {
  red();
  printf("Hello ");
  yellow();
  printf("world\n");
  reset();
  return 0;
}
Posted by: Guest on April-06-2021

Code answers related to "C"

Browse Popular Code Answers by Language