Selasa, 30 Juni 2015

program tukar nilai bilangan

 #include <iostream>
using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
    int a,b,c,d;
    cout<<">>>>>>>>>pertukaran nilai bilangan<<<<<<<<< \n";
    cout<<"\tnilai a =";
    cin>>a;
    cout<<"\tnilai b =";
    cin>>b;
    cout<<"\tnilai c =";
    cin>>c;
    d=a;
    a=b;
    b=c;
    c=d;
    cout<<"hasil:"<<"\na="<<a<<"\nb="<<b<<"\nc="<<c;
   
    return 0;
}



hasil dari program tersebut :

0 komentar:

Posting Komentar