C Program to Find Diameter, Circumference, and Area of a Circle

In this tutorial you will learn about the C Program to Find Diameter, Circumference, and Area of a Circle and its application with practical example.

 

C Program to Find Diameter, Circumference, and Area of a Circle

In this tutorial, we will learn to create a C program that will Find the Diameter, Circumference, and Area of a Circle 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.
  • Mathematical operations in C programming.

Algorithm:-

Program description:-

In today’s tutorial, we will create a program, that will calculate the Diameter, Circumference, and Area of a Circle using C programming. First, take the input radius of the circle from the user. Then we will calculate the Diameter, Circumference, and Area of a Circle using the mathematical expressions in the c programming language. At last, we will print the Diameter, Circumference, and Area of a Circle.

Program Code:-

Output:-

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

  •  rad = it will hold the integer value for the input radius of the circle.
  •  ar = it will hold the value of the area of the circle.
  •  cm = it will hold the value of the area of the circle.
  •  dm = it will hold the value of the area of the circle.

Taking Input the radius of the circle from the user.

Defining the functions for the program.

Calling the user-defined functions.

Body of the user-defined functions for the calculations.

Printing the Diameter, Circumference, and Area of a Circle.

In this tutorial we have learn about the C Program to Find Diameter, Circumference, and Area of a Circle and its application with practical example. I hope you will like this tutorial.