49. contoh manipulator setbase dengan DEV C++
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int MD;
cout<<"Penerapan Manipulator setbase()"<<"\n\n";
cout<<"Desimal Oktal Hexadesimal"<<endl;
cout<<"----------------------------"<<"\n";
for(MD=180;MD<=190;MD++){
cout<<setbase(10)<<MD<<" ";
cout<<setbase(8)<<MD<<" ";
cout<<setbase(16)<<MD<<endl;
}
return 0;
}
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
int MD;
cout<<"Penerapan Manipulator setbase()"<<"\n\n";
cout<<"Desimal Oktal Hexadesimal"<<endl;
cout<<"----------------------------"<<"\n";
for(MD=180;MD<=190;MD++){
cout<<setbase(10)<<MD<<" ";
cout<<setbase(8)<<MD<<" ";
cout<<setbase(16)<<MD<<endl;
}
return 0;
}
Komentar
Posting Komentar