SlideShare a Scribd company logo
1 of 6
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <graphics.h>
#include <dos.h>
/*
* calculatesthe positionforminute andsecondneedle.
* 360 to 90 degree isequivalentto45 to 0 th minute
* in clock. So, store the pointsinreverse direction(45to0)
* Once 0 is reached,we needtostore pointscorrespondsto
* 84th degree to0 degree inreverse direction(59to46). So,
* totallywe will get60 pointswhichcorrespondsto60
* minute orsecondpositioninclock.
*/
voidminSecCalc(intxrad,intmidx,intmidy,intx[60],inty[60]) {
inti,j = 45;
for(i = 360; i >= 0; i = i - 6) {
x[j] = midx - (xrad* cos((i * 3.14) / 180));
y[j--] =midy - (xrad* sin((i *3.14) / 180));
j = (j == -1) ? 59:j;
}
return;
}
/*
* findthe pointsat 0, 30, 60,.., 360 degrees
* on the givencircle. x value correpondsto
* radius* cos(angle) andyvalue corresponds
* to radius* sin(angle). Numbersinthe clock
* are writtenusingthe above manipulatedx and
* y values. Andthe hourneedle movement
* is basedon this
*/
voidcalcPoints(intradius,intmidx,intmidy,intx[12],inty[12]) {
intx1, y1;
/* 90, 270, 0, 180 degrees*/
x[0] = midx,y[0] = midy - radius;
x[6] = midx,y[6] = midy+ radius;
x[3] = midx + radius,y[3] = midy;
x[9] = midx - radius,y[9] = midy;
/* 30, 150, 210, 330 degrees*/
x1 = (int) ((radius/2) * sqrt(3));
y1 = (radius/2);
x[2] = midx + x1, y[2] = midy - y1;
x[4] = midx + x1, y[4] = midy+ y1;
x[8] = midx - x1,y[8] = midy+ y1;
x[10] = midx - x1, y[10] = midy - y1;
/* 60, 120, 210, 300 degrees*/
x1 = radius/ 2;
y1 = (int) ((radius/2) * sqrt(3));
x[1] = midx + x1, y[1] = midy - y1;
x[5] = midx + x1, y[5] = midy+ y1;
x[7] = midx - x1,y[7] = midy+ y1;
x[11] = midx - x1, y[11] = midy - y1;
return;
}
intmain() {
/* requestautodetection*/
intgdriver= DETECT, gmode,err,tmp;
inti,j, midx,midy,radius,hr,min,sec;
intx[12],y[12], minx[60],miny[60];
inthrx[12],hry[12],secx[60],secy[60];
intsecx1,secy1;
char str[256];
time_tt1;
structtm *data;
/* initialize graphicmode */
initgraph(&gdriver,&gmode,"C:/TC/BGI");
err= graphresult();
if (err!= grOk) {
/* error occurred*/
printf("GraphicsError:%s",
grapherrormsg(err));
return0;
}
/* midpositioninx andy -axis*/
midx = getmaxx()/2;
midy= getmaxy() /2;
radius= 200;
/* positiontolocate numbersinclock*/
calcPoints(radius - 30,midx,midy,x,y);
/* getspositionforhourneedle */
calcPoints(radius - 90,midx,midy,hrx,hry);
/* getspositionforminute needle*/
minSecCalc(radius - 50, midx,midy,minx,miny);
/* getspositionforsecondneedle */
minSecCalc(radius - 70, midx,midy,secx,secy);
while (!kbhit()){
setlinestyle(SOLID_LINE,1,3);
settextstyle(TRIPLEX_FONT,0,3);
/* draws frame of the clock*/
circle(midx,midy,radius);
/* place the numbers inclock*/
for (j = 0; j < 12; j++) {
if (j == 0) {
sprintf(str,"%d",12);
} else {
sprintf(str,"%d",j);
}
settextjustify(CENTER_TEXT,CENTER_TEXT);
moveto(x[j],y[j]);
outtext(str);
}
/* get the currenttime usingtime() API*/
t1 = time(NULL);
data = localtime(&t1);
/* draw the secondneedle inclock*/
sec = data->tm_sec% 60;
line(midx,midy,secx[sec],secy[sec]);
/* draw the minute needleinclock*/
min= data->tm_min%60;
line(midx,midy,minx[min],miny[min]);
/* draw the hour needle inclock*/
hr = data->tm_hour% 12;
line(midx,midy,hrx[hr],hry[hr]);
delay(1000);
cleardevice();
}
getch();
/* deallocate memoryallocatedforgraphicscreen*/
closegraph();
return0;
}

More Related Content

What's hot

Javascript Without Javascript
Javascript Without JavascriptJavascript Without Javascript
Javascript Without JavascriptPatrick Kettner
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignmentashikul akash
 
Statistics Cheatsheet by MIT
Statistics Cheatsheet by MITStatistics Cheatsheet by MIT
Statistics Cheatsheet by MITAshish Patel
 
Cara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blogCara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blogAkhmad Akbar
 
2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graphkinan keshkeh
 
Logic Design - Chapter 3: Boolean Algebra
Logic Design - Chapter 3: Boolean AlgebraLogic Design - Chapter 3: Boolean Algebra
Logic Design - Chapter 3: Boolean AlgebraGouda Mando
 
8.2 integration by parts
8.2 integration by parts8.2 integration by parts
8.2 integration by partsdicosmo178
 
Tabela completa de derivadas e integrais
Tabela completa de derivadas e integraisTabela completa de derivadas e integrais
Tabela completa de derivadas e integraisDiego Rodrigues Vaz
 
Convolution_System_Response
Convolution_System_ResponseConvolution_System_Response
Convolution_System_ResponseMatthew Mobley
 
Tabela derivadas-e-integrais
Tabela derivadas-e-integraisTabela derivadas-e-integrais
Tabela derivadas-e-integraismariasousagomes
 

What's hot (16)

Sheet 1
Sheet 1Sheet 1
Sheet 1
 
Javascript Without Javascript
Javascript Without JavascriptJavascript Without Javascript
Javascript Without Javascript
 
Sheet 3
Sheet 3Sheet 3
Sheet 3
 
Regras diferenciacao
Regras diferenciacaoRegras diferenciacao
Regras diferenciacao
 
Numerical Method Assignment
Numerical Method AssignmentNumerical Method Assignment
Numerical Method Assignment
 
Statistics Cheatsheet by MIT
Statistics Cheatsheet by MITStatistics Cheatsheet by MIT
Statistics Cheatsheet by MIT
 
Cara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blogCara membuat tulisan mengikuti kursor di blog
Cara membuat tulisan mengikuti kursor di blog
 
2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph2Bytesprog2 course_2014_c9_graph
2Bytesprog2 course_2014_c9_graph
 
Logic Design - Chapter 3: Boolean Algebra
Logic Design - Chapter 3: Boolean AlgebraLogic Design - Chapter 3: Boolean Algebra
Logic Design - Chapter 3: Boolean Algebra
 
8.2 integration by parts
8.2 integration by parts8.2 integration by parts
8.2 integration by parts
 
Tabela completa de derivadas e integrais
Tabela completa de derivadas e integraisTabela completa de derivadas e integrais
Tabela completa de derivadas e integrais
 
My Book
My BookMy Book
My Book
 
Sheet 2
Sheet 2Sheet 2
Sheet 2
 
Convolution_System_Response
Convolution_System_ResponseConvolution_System_Response
Convolution_System_Response
 
Tabela derivadas-e-integrais
Tabela derivadas-e-integraisTabela derivadas-e-integrais
Tabela derivadas-e-integrais
 
Caropro
CaroproCaropro
Caropro
 

Similar to Include stdio. wps office (1)

I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for SpeedYung-Yu Chen
 
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdfIfgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdffazilfootsteps
 
Advanced Search Techniques
Advanced Search TechniquesAdvanced Search Techniques
Advanced Search TechniquesShakil Ahmed
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Er Ritu Aggarwal
 
C Prog - Pointers
C Prog - PointersC Prog - Pointers
C Prog - Pointersvinay arora
 
#include iostream #include string #include invalidHr.h.pdf
 #include iostream #include string #include invalidHr.h.pdf #include iostream #include string #include invalidHr.h.pdf
#include iostream #include string #include invalidHr.h.pdfAPMRETAIL
 
Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2Tinker London
 
Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2Tinker
 
Interpolation graph c++
Interpolation graph c++Interpolation graph c++
Interpolation graph c++rpiitcbme
 
PPS Arrays Matrix operations
PPS Arrays Matrix operationsPPS Arrays Matrix operations
PPS Arrays Matrix operationsSreedhar Chowdam
 
fixed 3 issues. I am working on remaining.package chegg;public c.pdf
fixed 3 issues. I am working on remaining.package chegg;public c.pdffixed 3 issues. I am working on remaining.package chegg;public c.pdf
fixed 3 issues. I am working on remaining.package chegg;public c.pdfanjanacottonmills
 
Senior design project code for PPG
Senior design project code for PPGSenior design project code for PPG
Senior design project code for PPGFrankDin1
 

Similar to Include stdio. wps office (1) (20)

I have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdfI have written the code but cannot complete the assignment please help.pdf
I have written the code but cannot complete the assignment please help.pdf
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for Speed
 
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdfIfgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
Ifgqueue.h#ifndef LFGQUEUE_H #define LFGQUEUE_H#include pl.pdf
 
ES6(ES2015) is beautiful
ES6(ES2015) is beautifulES6(ES2015) is beautiful
ES6(ES2015) is beautiful
 
Snake.c
Snake.cSnake.c
Snake.c
 
Advanced Search Techniques
Advanced Search TechniquesAdvanced Search Techniques
Advanced Search Techniques
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
Rkf
RkfRkf
Rkf
 
C Prog - Pointers
C Prog - PointersC Prog - Pointers
C Prog - Pointers
 
C programs
C programsC programs
C programs
 
#include iostream #include string #include invalidHr.h.pdf
 #include iostream #include string #include invalidHr.h.pdf #include iostream #include string #include invalidHr.h.pdf
#include iostream #include string #include invalidHr.h.pdf
 
Cs580
Cs580Cs580
Cs580
 
Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2
 
Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2Programming for Artists and Designers: Week 2
Programming for Artists and Designers: Week 2
 
Interpolation graph c++
Interpolation graph c++Interpolation graph c++
Interpolation graph c++
 
PPS Arrays Matrix operations
PPS Arrays Matrix operationsPPS Arrays Matrix operations
PPS Arrays Matrix operations
 
fixed 3 issues. I am working on remaining.package chegg;public c.pdf
fixed 3 issues. I am working on remaining.package chegg;public c.pdffixed 3 issues. I am working on remaining.package chegg;public c.pdf
fixed 3 issues. I am working on remaining.package chegg;public c.pdf
 
C programs
C programsC programs
C programs
 
Vcs16
Vcs16Vcs16
Vcs16
 
Senior design project code for PPG
Senior design project code for PPGSenior design project code for PPG
Senior design project code for PPG
 

Recently uploaded

Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...
Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...
Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...chanderprakash5506
 
Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...
Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...
Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...amritaverma53
 
Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...
Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...
Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...soniyagrag336
 
ANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptxANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptxSwetaba Besh
 
Call 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room Delivery
Call 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room DeliveryCall 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room Delivery
Call 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room DeliveryJyoti singh
 
Cardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their RegulationCardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their RegulationMedicoseAcademics
 
💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...
💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...
💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...dilbirsingh0889
 
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...dishamehta3332
 
Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...
Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...
Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...call girls hydrabad
 
ANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptxANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptxSwetaba Besh
 
Call Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service Available
Call Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service AvailableCall Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service Available
Call Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service AvailableSteve Davis
 
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...Cara Menggugurkan Kandungan 087776558899
 
Call Girls Kathua Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Kathua Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Kathua Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Kathua Just Call 8250077686 Top Class Call Girl Service AvailableDipal Arora
 
Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...
Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...
Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...Dipal Arora
 
(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...
(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...
(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...TanyaAhuja34
 
Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...
Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...
Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...Janvi Singh
 
Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...
Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...
Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...Janvi Singh
 
Circulatory Shock, types and stages, compensatory mechanisms
Circulatory Shock, types and stages, compensatory mechanismsCirculatory Shock, types and stages, compensatory mechanisms
Circulatory Shock, types and stages, compensatory mechanismsMedicoseAcademics
 
Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...
Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...
Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...Janvi Singh
 
Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...
Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...
Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...minkseocompany
 

Recently uploaded (20)

Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...
Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...
Russian Call Girls In Pune 👉 Just CALL ME: 9352988975 ✅❤️💯low cost unlimited ...
 
Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...
Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...
Call Girl in Chennai | Whatsapp No 📞 7427069034 📞 VIP Escorts Service Availab...
 
Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...
Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...
Call Girls in Lucknow Just Call 👉👉8630512678 Top Class Call Girl Service Avai...
 
ANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptxANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF RESPIRATORY SYSTEM.pptx
 
Call 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room Delivery
Call 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room DeliveryCall 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room Delivery
Call 8250092165 Patna Call Girls ₹4.5k Cash Payment With Room Delivery
 
Cardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their RegulationCardiac Output, Venous Return, and Their Regulation
Cardiac Output, Venous Return, and Their Regulation
 
💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...
💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...
💞 Safe And Secure Call Girls Coimbatore🧿 6378878445 🧿 High Class Coimbatore C...
 
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
Race Course Road } Book Call Girls in Bangalore | Whatsapp No 6378878445 VIP ...
 
Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...
Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...
Call girls Service Phullen / 9332606886 Genuine Call girls with real Photos a...
 
ANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptxANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptx
ANATOMY AND PHYSIOLOGY OF REPRODUCTIVE SYSTEM.pptx
 
Call Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service Available
Call Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service AvailableCall Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service Available
Call Girls Rishikesh Just Call 9667172968 Top Class Call Girl Service Available
 
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
Cara Menggugurkan Kandungan Dengan Cepat Selesai Dalam 24 Jam Secara Alami Bu...
 
Call Girls Kathua Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Kathua Just Call 8250077686 Top Class Call Girl Service AvailableCall Girls Kathua Just Call 8250077686 Top Class Call Girl Service Available
Call Girls Kathua Just Call 8250077686 Top Class Call Girl Service Available
 
Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...
Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...
Bhawanipatna Call Girls 📞9332606886 Call Girls in Bhawanipatna Escorts servic...
 
(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...
(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...
(RIYA)🎄Airhostess Call Girl Jaipur Call Now 8445551418 Premium Collection Of ...
 
Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...
Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...
Lucknow Call Girls Service { 9984666624 } ❤️VVIP ROCKY Call Girl in Lucknow U...
 
Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...
Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...
Call Girls Service Jaipur {9521753030 } ❤️VVIP BHAWNA Call Girl in Jaipur Raj...
 
Circulatory Shock, types and stages, compensatory mechanisms
Circulatory Shock, types and stages, compensatory mechanismsCirculatory Shock, types and stages, compensatory mechanisms
Circulatory Shock, types and stages, compensatory mechanisms
 
Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...
Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...
Call Girls in Lucknow Just Call 👉👉 8875999948 Top Class Call Girl Service Ava...
 
Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...
Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...
Indore Call Girls ❤️🍑7718850664❤️🍑 Call Girl service in Indore ☎️ Indore Call...
 

Include stdio. wps office (1)

  • 1. #include <stdio.h> #include <conio.h> #include <string.h> #include <math.h> #include <time.h> #include <graphics.h> #include <dos.h> /* * calculatesthe positionforminute andsecondneedle. * 360 to 90 degree isequivalentto45 to 0 th minute * in clock. So, store the pointsinreverse direction(45to0) * Once 0 is reached,we needtostore pointscorrespondsto * 84th degree to0 degree inreverse direction(59to46). So, * totallywe will get60 pointswhichcorrespondsto60 * minute orsecondpositioninclock. */ voidminSecCalc(intxrad,intmidx,intmidy,intx[60],inty[60]) { inti,j = 45; for(i = 360; i >= 0; i = i - 6) { x[j] = midx - (xrad* cos((i * 3.14) / 180)); y[j--] =midy - (xrad* sin((i *3.14) / 180)); j = (j == -1) ? 59:j; }
  • 2. return; } /* * findthe pointsat 0, 30, 60,.., 360 degrees * on the givencircle. x value correpondsto * radius* cos(angle) andyvalue corresponds * to radius* sin(angle). Numbersinthe clock * are writtenusingthe above manipulatedx and * y values. Andthe hourneedle movement * is basedon this */ voidcalcPoints(intradius,intmidx,intmidy,intx[12],inty[12]) { intx1, y1; /* 90, 270, 0, 180 degrees*/ x[0] = midx,y[0] = midy - radius; x[6] = midx,y[6] = midy+ radius; x[3] = midx + radius,y[3] = midy; x[9] = midx - radius,y[9] = midy; /* 30, 150, 210, 330 degrees*/ x1 = (int) ((radius/2) * sqrt(3)); y1 = (radius/2);
  • 3. x[2] = midx + x1, y[2] = midy - y1; x[4] = midx + x1, y[4] = midy+ y1; x[8] = midx - x1,y[8] = midy+ y1; x[10] = midx - x1, y[10] = midy - y1; /* 60, 120, 210, 300 degrees*/ x1 = radius/ 2; y1 = (int) ((radius/2) * sqrt(3)); x[1] = midx + x1, y[1] = midy - y1; x[5] = midx + x1, y[5] = midy+ y1; x[7] = midx - x1,y[7] = midy+ y1; x[11] = midx - x1, y[11] = midy - y1; return; } intmain() { /* requestautodetection*/ intgdriver= DETECT, gmode,err,tmp; inti,j, midx,midy,radius,hr,min,sec; intx[12],y[12], minx[60],miny[60]; inthrx[12],hry[12],secx[60],secy[60]; intsecx1,secy1; char str[256]; time_tt1;
  • 4. structtm *data; /* initialize graphicmode */ initgraph(&gdriver,&gmode,"C:/TC/BGI"); err= graphresult(); if (err!= grOk) { /* error occurred*/ printf("GraphicsError:%s", grapherrormsg(err)); return0; } /* midpositioninx andy -axis*/ midx = getmaxx()/2; midy= getmaxy() /2; radius= 200; /* positiontolocate numbersinclock*/ calcPoints(radius - 30,midx,midy,x,y); /* getspositionforhourneedle */ calcPoints(radius - 90,midx,midy,hrx,hry);
  • 5. /* getspositionforminute needle*/ minSecCalc(radius - 50, midx,midy,minx,miny); /* getspositionforsecondneedle */ minSecCalc(radius - 70, midx,midy,secx,secy); while (!kbhit()){ setlinestyle(SOLID_LINE,1,3); settextstyle(TRIPLEX_FONT,0,3); /* draws frame of the clock*/ circle(midx,midy,radius); /* place the numbers inclock*/ for (j = 0; j < 12; j++) { if (j == 0) { sprintf(str,"%d",12); } else { sprintf(str,"%d",j); } settextjustify(CENTER_TEXT,CENTER_TEXT); moveto(x[j],y[j]); outtext(str); }
  • 6. /* get the currenttime usingtime() API*/ t1 = time(NULL); data = localtime(&t1); /* draw the secondneedle inclock*/ sec = data->tm_sec% 60; line(midx,midy,secx[sec],secy[sec]); /* draw the minute needleinclock*/ min= data->tm_min%60; line(midx,midy,minx[min],miny[min]); /* draw the hour needle inclock*/ hr = data->tm_hour% 12; line(midx,midy,hrx[hr],hry[hr]); delay(1000); cleardevice(); } getch(); /* deallocate memoryallocatedforgraphicscreen*/ closegraph(); return0; }