belongs to collection: collection of C++ quiz questions for beginners
Write a program that calculates the area and perimeter of a circle
#include <iostream> using namespace std; int main(){ float rad; const float pi=3.14159; cout<<"enter the radius of the circle:"; cin>>rad; float area=pi*rad*rad; float per=2*pi*rad; cout<<"area is:"<<area<<" "; cout<<"perimeter is:"<<per; }
Output:
enter the radius of the circle:15 area is:706.858 perimeter is:94.2477
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer