C Tutorial
Area of a rectangle = length * breadth
This C program gets length and breadth as user inputs and computes the area of a rectangle.
#include<stdio.h> void main() { int length, breadth, area=0; printf("\nFinds rectangle area\n-------------------"); printf("\nEnter Length: "); scanf("%d", &length); printf("Enter Breadth: "); scanf("%d", &breadth); area = length * breadth; printf("Rectangle Area: %d", area); }Output:
$ cc area-of-rectangle.c $ ./a.out Finds rectangle area ------------------- Enter Length: 8 Enter Breadth: 7 Rectangle Area: 56
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page