Program MengurutkanDuaBilangan
Deklarasi
x,y:integer
Algoritma
read (x,y)
if (x>y)
write (y, ',', x)
else
write (x, ',', y)
endif
CODING
/***PROGRAM BILANGAN TERURUT**/
#include<iostream>
using namespace std;
int main() {
/**DEKLARASI**/
int x,y;
/*ALGORITMA*/
cout<<"PROGRAM BILANGAN TERURUT"<<endl;
cout<<"Masukan bilangan pertama:"; cin>>x;
cout<<"Masukan bilangan kedua:";cin>> y;
if (x>y)
cout<<y<<","<<x<<endl;
else
cout<<x<<","<<y<<endl;
system("PAUSE");
}
KELUARAN
Download program disini https://drive.google.com/open?id=1CsFAmLFRbMIWqgPMoj9Xuu8SutiSdHv-
No comments:
Post a Comment