Skip to content

ex1

← Back

Basic Info

Computer Programming 1
└── Lecture 10 LAB Basic Concepts InputStream
    └── ex1.cpp

Preview

using namespace std;
#include <iostream>

int main(){
    float r, pi = 3.14;
    cout << "Please input radius:" << endl;
    cin >> r;

    float C = 2*pi*r;
    float A = pi*r*r;

    cout << "Circumference = " << C << endl;
    cout << "Area = " << A << endl;

    return 0;
}