Page

C program to convert Feet to Inch,convert Feet to centi-meters ,convert Feet to meters,convert Feet to kilometers

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
float f,cm,me,km,in;
float c=30.48;
float m=0.3048;
float k=0.0003048;
int ch;
clrscr();
printf("\t\t=======CONVERTER PROGRAM=======");
printf("\n\n\n\n");
jump:
printf("\n\n");
printf("Press 1. Convert Into Inches ");
printf("\n");
printf("Press 2. Convert Into Centi-Meter");
printf("\n");
printf("Press 3. Convert Into Meter");
printf("\n");
printf("Press 4. Convert Into Kilo-Meter");
printf("\n");
printf("Press 5. EXIT");
printf("\n\n\n");
printf("Enter Your choice : ");
scanf("%d",&ch);
switch(ch)
{
case 1:
clrscr();
printf("Enter Your Height In Feet : ");
scanf("%f",&f);
in=f*12;
printf("\t\n Your Height In Inches  %f ",in);
goto jump;
break;

case 2:
clrscr();
printf("Enter Your Height In Feet : ");
scanf("%f",&f);
cm=f*c;
printf("\t\n Your Height In Centi-Meters  %f ",cm);
goto jump;
break;


case 3:
clrscr();
printf("Enter Your Height In Feet : ");
scanf("%f",&f);
me=f*m;
printf("\t\n Your Height In Meters  %f ",me);
goto jump;
break;

case 4:
clrscr();
printf("Enter Your Height In Feet : ");
scanf("%f",&f);
km=f*k;
printf("\t\n Your Height In Kilo-Meters  %f ",km);
goto jump;
break;

case 5:
exit(0);
}
getch();
}

OUTPUT







No comments:

Post a Comment