Skip to content
Home » C Program to Find the Circumference of a Triangle

C Program to Find the Circumference of a Triangle

Learn about C Program to Find the Circumference of a Triangle in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

C Program to Find the Circumference of a Triangle

Program:

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

  printf("Enter three sides of the triangle: ");
  scanf("%f %f %f", &a, &b, &c);

  result = a + b + c;
  printf("circumference = %.2f", result);

  return 0;
}

Output:

Enter three sides of the triangle: 2 3 6
circumference = 11.00

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Codes :
C Program to Find the Circumference of a Circle
C Program to Convert Kilograms to Grams