C Language - Value Converter Software

 



#include <stdio.h>

#include <conio.h>

int main()

{

char input;

float kmsTOmiles = 0.621371;

float inchesTOfoot = 0.0833333;

float cmsTOinches = 0.393701;

float poundsTOkgs = 0.453592;

float inchesTOmeters = 0.0254;

float first, second;

while (1) {

printf ("\n Enter a following numbers to convert values\n 1- kms TO miles\n 2- inches TO foot\n 3- cms TO inches\n 4- pounds TO kgs\n 5- inches TO meters\n press q to quit\n");

scanf ("%c", &input);

// printf ("Enter quantity of first unit in terms \n");

// scanf ("%f ", &first);


switch (input) 

case '1':

printf ("Enter value to convert \n");

scanf ("%f", &first);

second = first * kmsTOmiles;

printf ("%f kilo meter is equals to %f miles \n", first, second);

break;

case '2':

printf ("Enter value to convert \n");

scanf ("%f", &first);

second = first * inchesTOfoot;


printf ("%f  inches is equals to %f foot \n", first, second);

break;

case '3':

printf ("Enter value to convert \n");

scanf ("%f", &first);

second = first * cmsTOinches;


printf ("%f centimeter is equals to %f inches \n", first, second);

break;

case '4':

printf (" Enter value to convert \n");

scanf ("%f", &first);

second = first * poundsTOkgs;


printf ("%f pound is equals to %f kilo \n", first, second);

break;

case '5':

printf ("Enter value to convert \n");

scanf ("%f", &first);

second = first * inchesTOmeters;


printf ("%f inches is equals to %f meter \n", first, second);

break;

case 'q':

printf ("Program is Ended....\n");

break;

default:

printf ("Please Enter a correct value* \n");

break;

 

return 0;


// ScreenShots:







Comments

Popular Posts