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

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

Procedure Oriented Programming (POP) और Object Oriented Programming (OOP) में अंतर जानने के लिए देखें—POP vs OOP

Object Oriented Programming (OOP) की विभिन्न अवधारणाओं को जानने के लिए देखें—Concepts of OOP

Flowchart to find area and circumference of Circle

Flowchart to find area and circumference of Circle

C program to find area and circumference of Circle

#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;
}

C++ program to find area and circumference of Circle

#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 of C C++ program to find area and circumference of Circle

Enter radius: 5
Area = 78.500000
Circumference = 31.400000
Enter radius: 12.5
Area = 490.874000 
Circumference = 78.539800   

Similar most common programs in C C++

  1. Sum of two entered numbers
  2. Average of three entered numbers
  3. Simple interest
  4. Total and Percent
  5. Swapping values of two variables
  6. Swapping without using third variable
  7. Celsius to Fahrenheit conversion
Share it to:

Published by

admin

I am a computer teacher, programmer and web developer