Site icon T4Tutorials.com

Area of Rectangle Program in C,C++ (C Plus Plus , CPP) with flowchart

Area of Rectangle Program in C, C++ (C Plus Plus, CPP) with flowchart.

Explanation of Area of Rectangle Program in C++ Diagram

Flowchart of Area of Rectangle Program C++

Area of Rectangle Program in C++, C, C Plus Plus , CPP
Figure: Flowchart of Area of Rectangle Program

Area of Rectangle Program in C++ (C Plus Plus, CPP) 

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{	
int len;
int width;
int area=0;
int par=0;
cout<<"Enter Length of the Rectangle: "<<endl;
cin>>len;
cout<<"Enter widthh of the Rectangle: "<<endl;
cin>>width;
area = len * width ;
par = 2 * (len + width);
cout<<"Area of Rectangle is: "<<area<<endl;
cout<<"Parameters of Rectangle Are: "<<par<<endl;
getch();
return 0;
}

Output

Area of Rectangle Program in C,C++, C Plus Plus , CPP
Figure: Area of Rectangle Program in C, C++, C Plus Plus, CPP.

Area of Rectangle Program in C

#include<stdio.h>
#include<conio.h>

void main()
{
int len;
int width;
int area=0;
int par=0;

printf("\nEnter Length of the Rectangle: ");

scanf("%d",&len);

printf("\nEnter width of the Rectangle: ");

scanf("%d",&width);

area = len * width;

par = 2 * (len + width) ;

printf("\n\nArea of Ractangle is: %d",area);

printf("\n\nParameters of Rectangle Are: %d",par);

getch();
}

Output

Area of Rectangle Program in C,C++, C Plus Plus , CPP
Figure: Area of Rectangle Program in C, C++, C Plus Plus, CPP.

Video Lecture

Exit mobile version