main driven program

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> #include <stdlib.h> void main(void) { int choice , l ,w ,b,h ,r ; float area ; printf("Input 1 for area of circle \n"); printf("Input 2 for area of rectangle \n"); printf("Input 3 for area of triangle \n"); printf("Input Your choice:"); scanf("%d",&choice); switch(choice){ case 1 : printf("enter the radius of circle :"); scanf("%d",&r); area = 3.14*r*r ; break; case 2: printf("enter the length of rectangle :"); scanf("%d",&l); printf("\nenter the width of rectangle :"); scanf("%d",&w); area = l * w ; break; case 3: printf("enter the height of triangle :"); scanf("%d",&h); printf("\nenter the base of triangle :"); scanf("%d",&w); area = .5 * b * h; break; default : printf("Wrong Input ! please select the correct input"); } printf("\nYour area %f",area); }
Editor Settings
Theme
Key bindings
Full width
Lines