C Program to Find Angle of a Triangle if two angles are given

In this tutorial you will learn about the C Program to Find Angle of a Triangle if two angles are given and its application with practical example.

C Program to Find Angle of a Triangle if two angles are given

In this tutorial, we will learn to create a C program that will Find the third Angle of a Triangle in C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • Arithmetic Operations in C Programming.

What is a triangle?

In geometry, a triangle is a shape generally to be drawn by three lines. The triangle has three interior angles and the total of its interior angle is 180 degrees.

Algorithm:-

Program description that will print the area of a Triangle:-

In this tutorial, we will create a program, that will find the angle of a triangle using C programming. First, take the input angle 1 and 2  of the triangle by the user. Then we will find the third angle using the arithmetic expression. At last, we will print the answer third angle.

 

Program Code:-

 

Output:-

In the above program, we have first initialized the required variable.

  • x = it will hold the value for the input first angle of the triangle.
  • y  = it will hold the value for the input second angle of the triangle.
  • z = it will hold the value for the third angle of the triangle.

Taking the Input the first and the second angle of the triangle.

Code to calculate the third angle of the triangle.

Printing output the third angle of the triangle.

In this tutorial we have learn about the C Program to Find Angle of a Triangle if two angles are given and its application with practical example. I hope you will like this tutorial.