/*FUNGSI TUKAR BILANGAN*/#pragma argsused#include <conio.h>#include <iostream.h>
int tukar(int &bil1,int &bil2){cout<<"Nilai Awal : "<<bil1<<" "<<bil2<<endl;int temp;temp=bil1;bil1=bil2;bil2=temp;cout<<"Setelah Ditukar : "<<bil1<<" "<<bil2<<endl;}
int main(){int nil1,nil2;cout<<"PROGRAM TUKAR NILAI"<<endl;cout<<"==================="<<endl;cout<<endl;cout<<"Nilai 1 : "; cin>>nil1;cout<<endl;cout<<"Nilai 2 : "; cin>>nil2;cout<<endl;cout<<endl;cout<<endl;tukar(nil1,nil2);cout<<endl;getch();}
0 comments:
Post a Comment