Menukarkan
Kedua Buah isi Gelas
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a, b, c;
cout << "Gelas A : " << endl;
cin >> a;
cout << "Gelas B : " << endl;
cin >> b;
c =b;
b =a;
a =c;
cout << "Gelas A = "<<a<< endl;
cout << "Gelas B = "<<b<< endl;
system("PAUSE");
return 0;
}
#include <string>
using namespace std;
int main()
{
int a, b, c;
cout << "Gelas A : " << endl;
cin >> a;
cout << "Gelas B : " << endl;
cin >> b;
c =b;
b =a;
a =c;
cout << "Gelas A = "<<a<< endl;
cout << "Gelas B = "<<b<< endl;
system("PAUSE");
return 0;
}
Tidak ada komentar:
Posting Komentar