Length Conversion Program Using C Language

#include
#include
void main(){
int ch,op=1;
float val;
start:
clrscr();
printf("\n\n\t\t\t\tLength Conversion\n");
printf("\n 1- MM 2- CM 3- Inch 4- Foot 5- Meter 6- Kilo Meter 7-Exit ");
do{
printf("\n\n\tEnter Your Choice\n");
gotoxy(27,7);
scanf("%d",&ch);
printf("\n\tEnter Your Value");
gotoxy(27,9);
scanf("%f",&val);
gotoxy(6,12);
printf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»");
gotoxy(6,14);
printf("ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ");
gotoxy(6,16);
printf("ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ");
gotoxy(6,18);
printf("ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ");
gotoxy(6,20);
printf("ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ");
gotoxy(6,22);
printf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");



switch(ch){
case(1): gotoxy(10,10);
printf("\n\t\t\t%f Milli Meter",val);
printf("\n\n\tCM =\t%f",val/10);
printf("\n\n\tM =\t%f",val/1000);
printf("\n\n\tKM =\t%f",val/1000000);
printf("\n\n\tInch=\t%f",val/25.4);
printf("\n\n\tFoot=\t%f",1/12.0*val/25.4);
break;
case(2): gotoxy(10,10);
printf("\n\t\t\t%f Centi Meter",val);
printf("\n\n\tMM =\t%f",val*10);
printf("\n\n\tM =\t%f",val/100);
printf("\n\n\tKM =\t%f",val/100000);
printf("\n\n\tInch=\t%f",val/2.54);
printf("\n\n\tFoot=\t%f",1/12.0*val/2.54);
break;
case(3): gotoxy(10,10);
printf("\n\t\t\t%f Inch",val);
printf("\n\n\tMM =\t%f",val*25.4);
printf("\n\n\tCM =\t%f",val*2.54);
printf("\n\n\tM =\t%f",val*0.0254);
printf("\n\n\tKM =\t%f",val*0.0000254);
printf("\n\n\tFoot=\t%f",val/12.0);
break;
case(4): gotoxy(10,10);
printf("\n\t\t\t%f Foot",val);
printf("\n\n\tMM =\t%f",val*304.8);
printf("\n\n\tCM =\t%f",val*30.48);
printf("\n\n\tM =\t%f",val*0.3048);
printf("\n\n\tKM =\t%f",val*0.0003048);
printf("\n\n\tInch=\t%f",val*12.0);

break;
case(5): gotoxy(10,10);
printf("\n\t\t\t%f Meter",val);
printf("\n\n\tMM =\t%f",val*1000.0);
printf("\n\n\tCM =\t%f",val*100.0);
printf("\n\n\tKM =\t%f",val/1000.0);
printf("\n\n\tInch=\t%f",val*39.3700788);
printf("\n\n\tFoot=\t%f",val*3.2808399);
break;
case(6): gotoxy(10,10);
printf("\n\t\t\t%f Kilo Meter",val);
printf("\n\n\tMM =\t%f",val/1000000.0);
printf("\n\n\tCM =\t%f",val/100000.0);
printf("\n\n\tM =\t%f",val/1000.0);
printf("\n\n\tInch=\t%f",val*3280.8399);
printf("\n\n\tFoot=\t%f",val*273.403325);
break;
default:
clrscr();
gotoxy(10,13);
printf("\n\t\t\tYour Main Option Is Wrong");
getch();
}
gotoxy(50,23);
printf("Designed By: Mr. SAEED AHMAD ");
gotoxy(50,24);
printf("+92-301-7640931 ®¯More 1/0 ");
scanf("%d",&op);
if(op==1)
goto start;
else ch=7;
}while(ch!=7);
//getch();
}

Comments

Anonymous said…
Khan g , What r u doing , left the Chess, because i know it when i was in makkah wood. From to now till you are lossing, i think you should left now chess and start another.


Husnain Haider
CMS Manager (IT)
www.emyproperty.com
www.empsolution.com

Popular posts from this blog

Unlock Your Future in Cybersecurity with Expert Online Training!

Binary Search Using C Language