startMiner - free and simple next generation Bitcoin mining software

Program that perform conversions ' Cm to Inches or Kilometer to miles

Program is taken from the book C++ IT series,chapter.no.5 exercise program.no,17
Program that input a value and a type of conversions Program should include following conversions
Program that Convert cm to km

  1. Cm = 0.394 inches
  2.  liter = 0.246 gallon
  3. kilometer = 0.622 miles
  4. kilogram = 2.2 pound


using namespace std;
#include<iostream>
#include<conio.h>
#include<cmath>
int main()
{

float value,result;
char conversion;
cout<<"There are four conversions:\n";
cout<<"Enter 'A' for centimeters to inches\n";
cout<<"Enter 'B' for Liter to Gallon\n";
cout<<"Enter 'C' for Kilometer to Miles\n";
cout<<"Enter 'D' for Kilogram to Pounds\n";
cout<<"\n";
cout<<"Enter conversion:";
cin>>conversion;

switch(conversion)
  {
  case 'A':
  case 'a':
  {
  cout<<"Enter centimeters:";
  cin>>value;
  result=value*0.349;
  cout<<value<<" cm"<<"="<<result<<" inches";
  }
break;
case 'B':
  case 'b':
  {
  cout<<"Enter Liter:";
  cin>>value;
  result=value*0.264;
  cout<<value<<" liter"<<"="<<result<<" gallon";
  }
break;
case 'C':
  case 'c':
  {
  cout<<"Enter Kilometers:";
  cin>>value;
  result=value*0.622;
  cout<<value<<" Km"<<"="<<result<<" miles";
  }
break;
case 'D':
  case 'd':
  {
  cout<<"Enter Kilogram:";
  cin>>value;
  result=value*2.2;
  cout<<value<<" Kg"<<"="<<result<<" pound";
  }
break;
  }
   getch();      
   return 0;
}

you can also make a conversion calculator with this program.
you can also find the following  conversion:

  • mm to cm
  • cm to m
  • length conversion
  • cm to mm
  • mm to m
  • km to m
  • convert cm to feet
  • m to cm
  • convert feet to cm
  • meters to centimeters
  • m to km
  • convert cm to in
  • cm to feet conversion
  • etc




Program that perform conversions ' Cm to Inches or Kilometer to miles Program that perform conversions ' Cm to Inches or Kilometer to miles Reviewed by Alpha on 3/08/2017 06:20:00 pm Rating: 5

No comments:

Theme images by mariusFM77. Powered by Blogger.