#include <stdio.h>void circle();void rectangle();void triangle();int ch,r,l,w,b,h;int main(){ while(1) { printf("1. Area of square\n"); printf("2. Area of Rectangle\n"); printf("3. Area of Triangle\n"); printf("4. Quit\n"); printf("Enter your choice : "); scanf("%d",&ch); switch(ch) { case 1: square(); break; case 2: rectangle(); break; case 3: triangle(); break; case 4: exit(1); default: printf("Invalid choice\n\n"); } }return 0;}void square(){ float area; printf("Input length of the square : "); scanf("%d",&l); area=l * l; printf("The area is : %f\n",area);}void rectangle(){ float area; printf("Input length : "); scanf("%d",&l); printf("Input width : "); scanf("%d",&w); area=lw; printf("The area is : %f\n",area);}void triangle(){ float area; printf("Input the heigth :"); scanf("%d",&h); printf("Input the base :"); scanf("%d",&b); area=.5b*h; printf("The area is : %f\n",area); }
-
Notifications
You must be signed in to change notification settings - Fork 0
MrVybes/group-6
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published