Posts

Showing posts from April, 2020

Ranibow design in c Language

Image
C Program to  Create rainbow #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gdriver = DETECT,gmode; int x,y,i;     initgraph(&gdriver,&gmode,"C:\\Turboc3\\BGI");     x=getmaxx()/2;     y=getmaxy()/2;     for(i=30;i<200;i++)     {         delay(100);         setcolor(i/10);         arc(x,y,0,180,i-10);     } getch(); } Out put

Print stars in c

Image
C Program to  Print stars #include<conio.h> #include<stdio.h> void main() {         int i,j,l;         clrscr();         for(j=1;j<5;j++)         {             for(i=4;i>=j;i--)             printf(" ");             for(l=1;l<=2*j-1;l++)             printf("*");             printf("\n");         }         for(i=1;i<=6;i++)         {             for(j=0;j<=i;j++)             printf(" ");       ...

Circle in C graphics

Image
C Program to  Draw Circle  #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> int main(void) {    /* request auto detection */    int gdriver = DETECT, gmode, errorcode;    int midx, midy;    int radius = 100;    /* initialize graphics and local variables */    initgraph(&gdriver, &gmode, "C:\\turboc3\\bgi");    /* read result of initialization */    errorcode = graphresult();    if (errorcode != grOk)  /* an error occurred */    {       printf("Graphics error: %s\n", grapherrormsg(errorcode));       printf("Press any key to halt:");       getch();       exit(1); /* terminate with an error code */    }    midx = getmaxx() / 2;    midy = getmaxy() / 2; ...