Program Tukar
Agustus 1, 2012
#include iostream; using namespace std; void tukar(int *A, int *B){ int temp; temp=*A; *A=*B; *B=temp; } int main(){ int A,B; cout<<"Masukkan nilai A = "; cin>>A; cout<<"Masukkan nilai B = "; cin>>B; cout<<"Sebelum ditukar"<<endl; cout<<"A : "<<A<<endl; cout<<"B : "<<B<<endl; cout<<"Sesudah ditukar"<<endl; tukar(A,B); cout<<"A : "<<A<<endl; cout<<"B : "<<B; cout<<endl; system("PAUSE"); return 0; }