Input length and breadth and calculate area of rectangle C Program

How to write a c program to input length and breadth and calculate area of rectangle in C programming ?


Solution:
//Program to input length and breadth and calculate area of rectangle.
#include<stdio.h>
#include<conio.h>

void main()
{
float length, breadth;

clrscr();

printf("Enter length and breadth of the rectangle: ");
scanf("%f%f", &length, &breadth);
printf("The area of rectangle of length %f and breadth %f is: %f", length, breadth, length * breadth);

getch();
}


Learn More :