-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexp-1-4.c
More file actions
42 lines (34 loc) · 876 Bytes
/
exp-1-4.c
File metadata and controls
42 lines (34 loc) · 876 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*************************************************************************
> File Name: exp-1-4.c
> Author: xiaoxiaoh
> Mail: xiaoxxhao@gmail.com
> Created Time: Mon Jun 26 16:44:13 2017
************************************************************************/
/*
* Write a C program to enter length and breadth of a rectangle and find its area.
*
* Example
*
* Input
* Input length: 5
* Input width: 10
*
* Output
* Area of rectangle = 50 sq. units
*
*/
#include <stdio.h>
int main()
{
float length, width, area;
/* read length and width of rectangle from user */
printf("Enter length of rectangle: ");
scanf("%f", &length);
printf("Enter width of rectangle: ");
scanf("%f", &width);
/* calculate area of reactangle */
area = length * width;
/* print area of rectangle */
printf("Area of rectangle = %f\n", area);
return 0;
}