repl.it
@ArlanPereira/

Functions exercise

C++

No description

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;

void getCircleArea(){
  int area;
  int radius;
  cout << " Input the radius of the circle ";
  cin >> radius;
  area = radius * radius * 3.14;
  cout <<" The area of a Circle is "<< area << endl;
}

int main() {

  int counter;
  cout << "How many Circles would you like?" << endl;
  cin >> counter;
  while(counter >0){
    cout << "Circle no. " << counter << endl;
    getCircleArea();
    counter --;
  }
  cout << "End of program";
}