How to write C Program to solve and finds out the answer S=(double)((double)((int)(S*100))/(double)(100)); in C Programming Language ?
Solution:
#include<math.h> #include<stdio.h> int main(){ double a=0, b=0, c=0, d=3.141592653; scanf("%lf",&a); scanf("%lf",&b); scanf("%lf",&c); if(a>0 && b>0 && c>0){ c=(c*d)/180; double S=a*b*sin(c)/2; double e=sqrt((a*a+b*b)-(2*a*b*cos(c))); double P=a+b+e; // S=(double)((double)((int)(S*100))/(double)(100)); printf("S = %.3g / P = %.3g",S,P); } else printf("S = 0 / P = 0"); return 0; }
Learn More :
math.h
Example
- C Program String - Alphabet Count Example
- C Program Array Example: Average
- C Program Array Example: Reverse
- C Program Switch - Case Example
- C Program if - else if - else Example
- C Program Friend & Operator: Point2D Example
- C Program Friend & Operator: Vector Example
- C Program Recursion Example
- C Program Structure Example-2
- C Program Structure Example
- C Program Pointer Example
- C Program Function Example
- C Program String Example
- C Program Character Example
- C Program sizeof & memcpy Example
- C Program Array Example
- C Program Side Length Example
- C Program Pipes()
- C Program 0-1000 to Ordinary
- C Program Roboturtle
- C Program to Destroys a Mailbox
- C Program to Destroys a semaphore
- C Code for Testing the pH Meter V1.0
- APA 102c test program
- How To Retarget the C Library printf function to the UART.