Tuesday, 15 December 2020

Write a Program in C++ to find the area and circumference of a circle

#include <iostream>

using namespace std;

main()

{

  float area,cir,r;

  cout<<"Enter the radius of the circle.\n";

  cin>>r;

  area=(22/7)*r*r;

  cir=2*(22/7)*r;

  cout<<"Area= "<<area<<endl;

  cout<<"Circumference= "<<cir<<endl;

}


No comments:

Post a Comment

Java Program to count the total number of characters in a string

 //Java Program to count the total number of characters in a string import java.util.*; public class CountChars {     public static void mai...