Horje
Manage Menu Driven Program using switch statement Code Example
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\n");
	printf("enter 2 for area of rectangal\n");
	printf("enter 3 for area of triagle\n");
	printf("enter your choise\n");
	scanf("%d",&ch);
	switch(ch) {
		case 1:
		                 printf("enter radious of circle\n");
		scanf("%d",&r);
		area=3.14*r*r;
		break;
		case 2:
		                  printf("enter lanth and width\n");
		scanf("%d%d",&l,&w);
		area=l*w;
		break;
		case 3:
		                  printf("enter the base and hight\n");
		scanf("%d%d",&b,&h);
		area=.5*b*h;
		break;
	}
	printf("area is=%f",area);
	getch();
}




C

Related
gnuplot rectangle border color Code Example gnuplot rectangle border color Code Example
c language float user input Code Example c language float user input Code Example
create arrya of chars malloc Code Example create arrya of chars malloc Code Example
fibbonacci series Code Example fibbonacci series Code Example
__isoc99_sscanf Code Example __isoc99_sscanf Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11