program to calculate the area of rectangle in c langauge
In this program we will now takes input form the user and calculate the area of the rectangle in c-programming languages
.
#include<stdio.h>
#include<conio.h>
void main()
{
int l,b,area=0;
printf("enter the value of the length or breadth\n");
scanf("%d %d",&l,&b);
area=l*b;
printf("the area of the rectangle is %d",area);
getch();
}
#include<conio.h>
void main()
{
int l,b,area=0;
printf("enter the value of the length or breadth\n");
scanf("%d %d",&l,&b);
area=l*b;
printf("the area of the rectangle is %d",area);
getch();
}
Output:-
l-4 and b=5
area of the rectangle is 20.
No comments:
Post a Comment