1. Algoritma konversi jarak
- Deklarasi
m tipe data float (input)
cm,inci tipe data float (output)
- Deskripsi
membaca inputan variable m
variable m dimasukkan ke rumus cm=m*100 dan inci=(m*100)/2.54
outputnya rumus cm dan inci
2.Sourch Code C++
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
float m,cm,inci;
cout<<"Konversi m ke cm dan inci"<<endl<<endl;
cout<<"Masukkan m : ";
cin>>m;
cm=m*100;
inci=(m*100)/2.54;
cout<<endl;
cout<<"hasil m => cm = "<<cm<<endl;
cout<<"hasil m => inci = "<<inci;
return 0;
}
3.Dengan Raptor
0 komentar:
Posting Komentar