Q-9.Write a C Program to input two angles from user and find third angle of the triangle. How to find all angles of a triangle if two angles are given by user using C programming. C program to calculate the third angle of a triangle if two angles are given.

0 minute read
0

  1. #include<stdio.h>
  2. #define SUM 180
  3. int main(){
  4.   //1
  5.   float firstAngle,secondAngle,thirdAngle;
  6.   //2
  7.   printf("Enter first and second angle of the triangle : ");
  8.   scanf("%f %f",&firstAngle,&secondAngle);
  9.   //3
  10.   thirdAngle = SUM - (firstAngle + secondAngle);
  11.   //4
  12.   printf("You have entered %f and %f\n",firstAngle,secondAngle);
  13.   printf("Third Angle is : %f \n",thirdAngle);
  14.   return 0;
  15. }



Post a Comment

0Comments
Post a Comment (0)