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