[Let us C Solution ] C Program TO Find Any Trigonametric value
Code:-
#include<stdio.h>
#include<conio.h>
#include<windows.h>
#include<math.h>
void main(){
float a;
int ch;
do{
system("cls");
printf("\n\n\t\t\tTRIGINAMETRICAL MATH");
printf("\n\n\t\tENTER ANGLE : ");
scanf("%f",&a);
printf("\n\n\t\t\t\tMENU\n\n");
printf("\n\n\t\t1.SIN");
printf("\n\n\t\t2.COS");
printf("\n\n\t\t3.TAN");
printf("\n\n\t\t4.COSEC");
printf("\n\n\t\t5.SEC");
printf("\n\n\t\t6.COT");
printf("\n\n\t\t7.EXIT");
printf("\n\n\t\tENTER YOUR CHOICE AS 1,2,3,4,5,6 ...");
scanf("%d",&ch);
switch(ch){
case 1:
printf("\n\n\t\tSINE VALUE : %f",sin(a));
getch();
break;
case 2:
printf("\n\n\t\tCOS VALUE : %f",cos(a));
getch();
break;
case 3:
printf("\n\n\t\tTAN VALUE : %f",sin(a)/cos(a));
getch();
break;
case 4:
printf("\n\n\t\tCOSEC VALUE : %f",1/sin(a));
getch();
break;
case 5:
printf("\n\n\t\tSEC VALUE : %f",1/cos(a));
getch();
break;
case 6:
printf("\n\n\t\tCOT VALUE : %f",cos(a)/sin(a));
getch();
break;
case 7:
exit(0);
default:
printf("\n\n\t\tYOU HAVE ENTREED WRONG CHOICE .....");
printf("\n\n\t\tENTER YOUR CHOICE AS 1,2,3,4,5,6 ...");
printf("\n\n\t\tPRESS ANY KEY TO CONTINUE..............");
getch();
break;
}
}while(1);
getch();
}
Comments
Post a Comment