Programming Loacha
Tuesday, 14 February 2017
Tuesday, 7 February 2017
Monday, 30 January 2017
C-PROGRAM FOR THE ANALOG CLOCK :
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int i,gd=DETECT,gm ;
struct time t ;
float p,q,r;
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
for(i=0;i<120;i++)
{
setcolor(BLACK);
putpixel(200,200,WHITE);
circle(200,200,100) ;
outtextxy(190,110,"12");
outtextxy(195,280,"6");
outtextxy(110,200,"9");
outtextxy(280,200,"3");
outtextxy(270,160,"2");
outtextxy(120,240,"8");
outtextxy(240,130,"1");
outtextxy(150,270,"7");
outtextxy(270,240,"4");
outtextxy(240,270,"5");
outtextxy(140,130,"11");
outtextxy(115,160,"10");
gettime(&t);
printf(" %d %d %d ",t.ti_hour%12,t.ti_min,t.ti_sec) ;
p=t.ti_sec*3.14/30-3.14/2;
q=t.ti_min*3.14/30-3.14/2;
r=(t.ti_hour%12)*3.14/30-3.14*1.25;
setcolor(RED);
line(200,200,200+80*cos(p),200+80*sin(p)); setcolor(BLUE);
line(200,200,200+60*cos(q),200+60*sin(q));
setcolor(GREEN);
line(200,200,200+40*cos(r),200+40*sin(r));
delay(1000); clrscr();
}
getch();
}
@k
#include<stdio.h>
#include<graphics.h>
#include<dos.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int i,gd=DETECT,gm ;
struct time t ;
float p,q,r;
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
for(i=0;i<120;i++)
{
setcolor(BLACK);
putpixel(200,200,WHITE);
circle(200,200,100) ;
outtextxy(190,110,"12");
outtextxy(195,280,"6");
outtextxy(110,200,"9");
outtextxy(280,200,"3");
outtextxy(270,160,"2");
outtextxy(120,240,"8");
outtextxy(240,130,"1");
outtextxy(150,270,"7");
outtextxy(270,240,"4");
outtextxy(240,270,"5");
outtextxy(140,130,"11");
outtextxy(115,160,"10");
gettime(&t);
printf(" %d %d %d ",t.ti_hour%12,t.ti_min,t.ti_sec) ;
p=t.ti_sec*3.14/30-3.14/2;
q=t.ti_min*3.14/30-3.14/2;
r=(t.ti_hour%12)*3.14/30-3.14*1.25;
setcolor(RED);
line(200,200,200+80*cos(p),200+80*sin(p)); setcolor(BLUE);
line(200,200,200+60*cos(q),200+60*sin(q));
setcolor(GREEN);
line(200,200,200+40*cos(r),200+40*sin(r));
delay(1000); clrscr();
}
getch();
}
@k
Sunday, 29 January 2017
FACTS ABOUT C-LANGUAGE :
- C was invented to write an operating system called UNIX.
- C is a successor of B language which was introduced around 1970
- The language was formalized in 1988 by the American National Standard Institue (ANSI).
- By 1973 UNIX OS almost totally written in C.
- Today C is the most widely used System Programming Language.
- Most of the state of the art software have been implemented using C
Subscribe to:
Comments (Atom)