Printing colors

 

#include<stdio.h>

int main (){
    int i,c;
    //printf("enter the number of rows you want");



   // scanf("%d",&n);
   
    for ( i = 0; i<= 10; i++){
       // printf("\033[30;1;5m "); 
        for (c = 0;c <=(10-i);c++){
            printf("\033[32;1;3m");
            printf(" ");
        }
        for (c=0;c<=i ; c++){   
           printf("\033[41;31;5m ");
        }
        for(c=0;c<=i-1;c++){
            printf(" ");
        }
        for (c=0;c<= 10-i;c++ ){
            printf("\033[32;1;3m");
            printf(" ");
        }
        printf("\n");
       
       
       
    }
   
}






Comments

Popular posts from this blog

Snake game.c

Type declaration

Array with function