Find third angle of the triangle

SemiColon
By -
0
5. Write a C Program to input two angles from user and find third angle of the triangle. 

Example:

Input
Enter first angle: 60
Enter second angle: 80

Output
Third angle = 40

Solution:


#include<stdio.h>
int main ()
{
    int a,b,c;

    printf("Enter first angle: ");
    scanf("%d",&a);
    printf("Enter second angle: ");
    scanf("%d",&b);

    c = 180-(a+b);

    printf("Third angle = %d\n",c);

    return 0;

}



Tags:

Post a Comment

0Comments

Post a Comment (0)