Add to Favorites    Make Home Page 1898 Online  
 Language Categories  
 Our Services  

Home » C Home » Mathematics Home » PROGRAMM TO MATH CALCULATIONS

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title PROGRAMM TO MATH CALCULATIONS
Author Mohammed Badawy
Author Email war_device [at] hotmail.com
Description we can get the area or surround of:-
circle,triangles,quadangles and square
Category C » Mathematics
Hits 387278
Code Select and Copy the Code
Parameters : Code : #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<ctype.h> #include<string.h> #include<math.h> #define pi 3.1428571 float calculating_circle_surround() { float redius,surround; printf("To get the surround value please enter the redius value : "); scanf("%f",&redius); surround=2*pi*redius; printf("The surround is : %f",surround); return(surround); } float calculating_circle_area() { float redius,area; printf(" To get the area value please enter the redius value : "); scanf("%f",&redius); area=(redius*redius)*pi; printf("The area is : %f ",area); return(area); } float calculating_square_surround() { float edge,surround; printf(" To get the surround value please enter the edge value : "); scanf("%f",&edge); surround=4*edge; printf("The surround is : %f ",surround); return(surround); } float calculating_square_area() { float edge,area; printf(" To get the area value please enter the edge value : "); scanf("%f",&edge); area=edge*edge; printf("The area is : %f ",area); return(area); } float calculating_quad_surround() { float edge1,edge2,surround; printf(" To get the surround value please enter the edge1 value : "); scanf("%f",&edge1); printf(" To get the surround value please enter the edge2 value : "); scanf("%f",&edge2); surround=2*(edge1+edge2); printf("The area is : %f ",surround); return(surround); } float calculating_quad_area() { float edge1,edge2,area; printf(" To get the area value please enter the edge1 value : "); scanf("%f",&edge1); printf(" To get the area value please enter the edge2 value : "); scanf("%f",&edge2); area=edge1*edge2; printf("The area is : %f ",area); return(area); } float calculating_triangle_surround() { float edge1,edge2,edge3,surround; printf(" To get the surround value please enter the edge1 value : "); scanf("%f",&edge1); printf(" To get the surround value please enter the edge2 value : "); scanf("%f",&edge2); printf(" To get the surround value please enter the edge3 value : "); scanf("%f",&edge3); surround=edge1+edge2+edge3; printf("The area is : %f ",surround); return(surround); } float calculating_triangle_area() { float edge1,edge2,angle,area; printf(" To get the area value please enter the edge1 value : "); scanf("%f",&edge1); printf(" To get the area value please enter the edge2 value : "); scanf("%f",&edge2); printf(" To get the area value please enter the angle value : "); scanf("%f",&angle); angle=(angle*pi)/180; area=.5*edge1*edge2*(sin(angle)); printf("The area is : %f ",area); return(area); } main() { first: char a,b,c; printf("Please select the operation:- "); printf("---------------------------- "); printf("(C)ircle calculations "); printf("(S)quare calculations "); printf("(Q)uadeangles calculations "); printf("(T)riangles calculations "); printf("(E)xit : "); a=getch(); if(a=='c') { back_to_c: clrscr(); printf("Select an operation:- "); printf("-------------------- "); printf("(S)urround of the circle "); printf("(A)rea of the circle "); printf("(B)ack : "); b=getch(); if(b=='s'){clrscr(); calculating_circle_surround(); do_anther_op_cs: printf(" anther circle surround operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_circle_surround();goto do_anther_op_cs;getch();}; if(c=='n'){goto back_to_c;}; exit(0); } if(b=='a'){clrscr(); calculating_circle_area(); do_anther_op_ca: printf(" anther circle area operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_circle_area();goto do_anther_op_ca;getch();}; if(c=='n'){goto back_to_c;}; exit(0); } if(b=='b'){clrscr(); goto first;} } if(a=='s') { back_to_s: clrscr(); printf("Select an operation:- "); printf("-------------------- "); printf("(S)urround of the square "); printf("(A)rea of the square "); printf("(B)ack : "); b=getch(); if(b=='s'){clrscr(); calculating_square_surround(); do_anther_op_ss: printf(" anther square surround operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_square_surround();goto do_anther_op_ss;getch();}; if(c=='n'){goto back_to_s;}; exit(0); } if(b=='a'){clrscr(); calculating_square_area(); do_anther_op_sa: printf(" anther square area operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_square_area();goto do_anther_op_sa;getch();}; if(c=='n'){goto back_to_s;}; exit(0); } if(b=='b'){clrscr(); goto first;} } if(a=='q') { back_to_q: clrscr(); printf("Select an operation:- "); printf("-------------------- "); printf("(S)urround of the quadangles "); printf("(A)rea of the quadangles "); printf("(B)ack : "); b=getch(); if(b=='s'){clrscr(); calculating_quad_surround(); do_anther_op_qs: printf(" anther quadangles surround operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_quad_surround();goto do_anther_op_ss;getch();}; if(c=='n'){goto back_to_q;}; exit(0); } if(b=='a'){clrscr(); calculating_quad_area(); do_anther_op_qa: printf(" anther quadangles area operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_quad_area();goto do_anther_op_qa;getch();}; if(c=='n'){goto back_to_q;}; exit(0); } if(b=='b'){clrscr(); goto first;} } if(a=='t') { back_to_t: clrscr(); printf("Select an operation:- "); printf("-------------------- "); printf("(S)urround of the triangles "); printf("(A)rea of the triangles "); printf("(B)ack : "); b=getch(); if(b=='s'){clrscr(); calculating_triangle_surround(); do_anther_op_ts: printf(" anther triangles surround operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_triangle_surround();goto do_anther_op_ts;getch();}; if(c=='n'){goto back_to_t;}; exit(0); } if(b=='a'){clrscr(); calculating_triangle_area(); do_anther_op_ta: printf(" anther triangles area operation?(Y/N) "); c=getch(); if(c=='y'){clrscr(); calculating_triangle_area();goto do_anther_op_ta;getch();}; if(c=='n'){goto back_to_t;}; exit(0); } if(b=='b'){clrscr(); goto first;} } if(a=='e'){clrscr(); printf("Thank you for using our software... "); printf("Engineer/Muhammad Saeed Badawy "); printf(" [email protected]");} getch(); }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi �դ ?�� ��??���
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=1032


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review