Search
 
SCRIPT & CODE EXAMPLE
 

C

Manage Menu Driven Program using switch statement

#include<stdio.h>
#include<conio.h>
void main () {
	int ch,r,l,w,b,h;
	float area;
	clrscr();
	printf("enter 1 for area of circle
");
	printf("enter 2 for area of rectangal
");
	printf("enter 3 for area of triagle
");
	printf("enter your choise
");
	scanf("%d",&ch);
	switch(ch) {
		case 1:
		                 printf("enter radious of circle
");
		scanf("%d",&r);
		area=3.14*r*r;
		break;
		case 2:
		                  printf("enter lanth and width
");
		scanf("%d%d",&l,&w);
		area=l*w;
		break;
		case 3:
		                  printf("enter the base and hight
");
		scanf("%d%d",&b,&h);
		area=.5*b*h;
		break;
	}
	printf("area is=%f",area);
	getch();
}
Comment

PREVIOUS NEXT
Code Example
C :: iulia vântur 
C :: #include <stdio.h int main() { int x = 10, *y, **z; y = &x; z = &y; printf(""%d %d %d"", *y, **z, *(*z)); return 0; } 
C :: batteries included 
C :: C fgets() and puts() 
C :: listas enlazadas/ linked lists 
C :: C (Windows) 
C :: gotoxy not working in dev c++ 
C :: navigate to line intellij 
C :: how to get a string input in c 
C :: params in main function in C 
C :: perfect numbers in c 
C :: youtube code 
C :: time random c 
C :: open cv 
Dart :: debug banner flutter 
Dart :: dart get String input from user 
Dart :: flutter lock screen to portrait mode 
Dart :: flutter textfield outlineinputborder 
Dart :: color of status bar flutter 
Dart :: flutter array of strings 
Dart :: raisedbutton shape flutter 
Dart :: flutter loading images over network 
Dart :: flutter file size 
Dart :: text input validation message color flutter 
Dart :: flutter multipline textfield height 
Dart :: flutter full screen bottom sheet 
Dart :: how to give bottom padding in Listview in flutter 
Dart :: dart date add month 
Dart :: check if string contain number dart flutter 
Dart :: dart switch case 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =