Kilobytes to Megabytes Conversion in C++

This Program converts Kilobyte data into Megabyte. The General formula for this conversion is 1024 Kilobyte is equal one Megabyte.This program will take three input(kilobyte data) and then convert them into megabyte.

Source Code

#include<iostream>
using namespace std;
int main ()
{
 double kilobyte,kilobyte1,kilobyte2;
 int megabyte = 1024;
 cout<<"\t \t \t LEP DATA CONVERTER \n \n";
 cout<<"Enter the Kilobyte to Convert in Megabyte : ";
 cin>>kilobyte;
 cout<<"Enter the Kilobyte to Convert in Megabyte : ";
 cin>>kilobyte1;
 cout<<"Enter the Kilobyte to Convert in Megabyte : ";
 cin>>kilobyte2;
 cout<<endl<<endl;
  cout<<"\t \t KiloBytes " <<"\t \t MegaBytes \n \n ";
  cout<<"\t \t "<<kilobyte<<" \t \t \t "<<kilobyte/megabyte <<endl;
  cout<<"\t \t "<<kilobyte1<<" \t \t \t "<<kilobyte1/megabyte<<endl;
  cout<<"\t \t "<<kilobyte2<<" \t \t  \t "<<kilobyte2/megabyte;
  return 0;
 }

Output of the Program

Kilobytes to Megabytes conversion in C++

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment