Program PertukaranDuaBilangan
Deklarasi
a,b,c:integer
Algoritma
read (a,b)
c<-a
a<-b
b<-c
write (a,b)
CODING
#include<iostream>
using namespace std;
int main() {
int a,b,c;
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
c=a;
a=b;
b=c;
cout<<" "<<endl;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
cout<<" "<<endl;
system("PAUSE");
}
KELUARAN
Download program disini https://drive.google.com/open?id=1GKMJXyOZMbSRv7bqPQR7mpK6KLsCCWLz
No comments:
Post a Comment