Berlangganan

About Me


contoh 17

// program untuk mempertukarkan nilai A dengan nilai B
# include <iostream.h>
void main ()
{
 int A, B, temp;
 cout << " A = ";
 cin >> A;

 cout << " B = ";
 cin >> B;

 temp = A;
 A = B;
 B = temp;
 cout << "jadi sekarang : " << endl;
 cout << "A = " << A << endl;
 cout << "B = " << B;
}

 output

A = 1
B = 2
jadi sekarang :
A = 2
B = 1

0 Response to "contoh 17"

Post a Comment