Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » BeginnersRSS Feeds

color program without using graphics

Posted By: Bappaditya Sar     Category: C Programming     Views: 13622

This program shows how to print color in c language with blink function

    #include<stdio.h>
    #include<conio.h>
    void main()
     
    {
    clrscr();
    int i,b,l,r,x=41;
    for(i=1;i<=12;i++)
    {
    for(b=1;b<=x;b++)
    printf(" ");
    x--;
    for(l=1;l<i;l++)
      {
    textcolor(3+128);
    cprintf("%c",4);
      }
      for(r=i-1;r>=1;r--)
      {
      textcolor(4+128);
      cprintf("%c",4);
      }
      printf("\n");

      }
      x=37;
      for(i=1;i<=13;i++)
        {
        for(b=1;b<=x;b++)
        printf(" ");
        textcolor(2+128);
        for(l=1;l<=4;l++)
        cprintf("%c",2);
        for(b=1;b<=0;b++)
        printf(" ");
        textcolor(5+128);

        for(l=1;l<=4;l++)
        cprintf("%c",3);
        printf("\n");
          }
           _setcursortype(_NOCURSOR);//this function is use for hide cursor
           getch();
            }


  
Share: 


Didn't find what you were looking for? Find more on color program without using graphics Or get search suggestion and latest updates.

Bappaditya Sar
Bappaditya Sar author of color program without using graphics is from India.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!