CPP
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
25
26
27
28
// Created by EOK
#include <iostream>
using namespace std;
#define pi 3.142 //declaring a constant
int main()
{
//declare variables
float length,width,height,base,radius,area;
int selection = 8;
cout<<"Select\n 1: rectangle\n 2: triangle\n 3:circle\n 4:parallelogram\n";
cout<<"5: a closed cylinder\n";
cin>>selection;
if(selection== 1)
//instruction to users
{
cout<<"You have selected rectangle\n";
cout<<"\nEnter length:";
cin>>length;
cout<<"\nEnter width:";
cin>>width;
cout<<"You have entered length as: "<<length<< "and width as:";
cout<<width<<endl;
area = length*width;
//computing area of the geometric figure
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run