Bytes to kilobytes Conversion in C++

Bytes and Kilobytes are the units of data and we measure data in such types of units. These terms and data unit frequently used in computer science , software engineering and in IT departments. In this program we just convert bytes into kilobytes. The simple formula to calculate it is 1 kilobyte is equal to 1024 bytes.

Source Code

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

Output of the Program

Bytes to kilobytes 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