write a complete c program where you create a user defined function that calculates the circumference of a circle. the user has the option to provide the diameter or the radius of the circle.



Answer :

The program is given below in C++ with a user defined function to calculate circumference of a circle.

#include <iostream>

#define PI 3.14

using namespace std;

void Cal_Crcmfrnc(float); // function prototype

int main()

{

   float radius;  // declaring variable

   cout<< "Enter Radius : ";   // prompting for input

   cin>> radius;  //

   Cal_Crcmfrnc(radius); // function call

   return 0;

}

void Cal_Crcmfrnc(float rds)  // function definition

{

   float crcumference;  //declaring variable

   crcumference = 2 * PI * rds;   // calculating circumference

   cout<< "Circumference of the Circle :  " << crcumference;  //displaying  output

}

Here, in the attachment the complete program with output is provided.

You can learn more about C++ Functions at

https://brainly.com/question/24172315

#SPJ4

View image asarwar