write a program that takes storage capacity in GB from user and convert it into MBs
#include <iostream>
using namespace std;
int main() {
long mb, gb;
// Asking for input
cout<<"Enter the size in GB: ";
cin>>gb;
// GB to MB Conversion
mb = gb * 1024;
// Displaying output
cout<<gb<<" Gigabytes = "<<mb<<" Megabytes\n\n";
system("pause");
return 0;
}
Comments
Leave a comment