write a programe in C language to calculate area of rectangle
Answers
Answered by
2
Answer:
Algorithm
- Define the width of the rectangle.
- Define the Height of the rectangle.
- Define Area of the rectangle.
- Calculate the area of the rectangle by multiplying the width and height of the rectangle.
- Assign the area of the rectangle to the area variable.
- print the area of the rectangle.
Complexity
Solution
C Program
#include <stdio.h>
int main()
{
int width=5;
int height=10;
int area=width*height;
printf("Area of the rectangle=%d",area);
}
Answered by
0
Answer:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float length, width, area;
cout<<"\nEnter length of rectangle";
cin>>length;
cout<<"\nEnter width of rectangle";
cin>>width;
area=length*width;
cout<<"\nArea of rectangle is "<<area;
getch();
}
Similar questions