C C++ program to find area and circumference of Circle

Flowchart

Flowchart to find area and circumference of Circle

Coding in C

#include<stdio.h>                                                                                                 int main()
{
float r,a,c;
printf(“Enter radius: “);
scanf(“%f”,&r);
a=3.14*r*r;
c=2*3.14*r;
printf(“Area = %f”,a);
printf(“\nCircumference = %f”,c);
return 0;
}

Coding in C++

#include<iostream>                                                                                        using namespace std;
int main()
{
float r,a,c;
cout<<“Enter radius: “; cin>>r;
a=3.14*r*r;
c=2*3.14*r;
cout<<“Area = “<<a<<endl;
cout<<“Circumference = “<<c<<endl;
return 0;
}

Output

Find area and circumference of circle program output

Published by

admin

I am a computer teacher, programmer and web developer