Search
 
SCRIPT & CODE EXAMPLE
 

C

C colourful output

#include <stdio.h>

//defining all combinations to be used.
#define RED   "x1B[31m"
#define GRN   "x1B[32m"
#define YEL   "x1B[33m"
#define BLU   "x1B[34m"
#define MAG   "x1B[35m"
#define CYN   "x1B[36m"
#define WHT   "x1B[37m"
#define RESET "x1B[0m"

int main() {
	//Using defines very easily without a need for '%s' of 'x1B[...'
    printf(RED "red
"     RESET);
    printf(GRN "green
"   RESET);
    printf(YEL "yellow
"  RESET);
    printf(BLU "blue
"    RESET);
    printf(MAG "magenta
" RESET);
    printf(CYN "cyan
"    RESET);
    printf(WHT "white
"   RESET);
	
  	return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: remix icon cdn 
C :: bold text in c 
C :: docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. 
C :: install kubernetes kubectl on mac 
C :: fahrenheit to celsius formula 
C :: plt hide axis ticks 
C :: print an array in c 
C :: write in file in c 
C :: find maximum number between 3 numbers in c 
C :: disable lua errors 
C :: express.static public 
C :: dvlprroshan 
C :: Write a C program to find reverse of an array 
C :: c get random float 
C :: how to add two numbers in c programming 
C :: c for schleife 
C :: c programming itoa() example 
C :: hi servicenow 
C :: to find greatest of 4 numbers in c 
C :: c print multiple variables 
C :: c if 
C :: how to reverse a string in c 
C :: casting an int to a char in c 
C :: c read file 
C :: simple calculator, using switch statement in C 
C :: how to take blank space in c scanf 
C :: gcd and lcd in c 
C :: C program for float division of numbers 
C :: ecrire programme en C une fonction remplir tableau et un fonction inverser 
C :: c program to find minimum of 5 numbers using conditional operator in c 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =