A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a language program which accepts the radius of a circle from the user and compute the area and circumference
Q:

Write a language program which accepts the radius of a circle from the user and compute the area and circumference

0

Write a language program which accepts the radius of a circle from the user and compute the area and circumference

Sample Output:

Find the area and circumference of any circle :                       
----------------------------------------------------                   
 Input the radius(1/2 of diameter) of a circle : 5                     
 The area of the circle is : 78.5397                                   
 The circumference of the circle is : 31.4159

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
#define PI 3.14159
using namespace std;

    int main()
    {
    	float radius, area, circum;
		cout << "\n\n Find the area and circumference of any circle :\n";
		cout << "----------------------------------------------------\n";		
        cout<<" Input the radius(1/2 of diameter) of a circle : ";
    	cin>>radius;
	
		circum = 2*PI*radius;
		area = PI*(radius*radius);
        cout<<" The area of the circle is : "<< area << endl;
        cout<<" The circumference of the circle is : "<< circum << endl;		
		
        cout << endl;
        return 0;
    }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now