Senin, 05 Maret 2012

program pertukaran angka

#include<stdio.h>
#include<conio.h>

void tukar_angka(int *pw,int *py)
{
int temp=*pw;
*pw=*py;
*py=temp;
}
int main(void){
int a=90,b=75;

printf("Sebelum Pertukaran Angka:\n");
printf("\nNilai 1=%d\n",a);
printf("Nilai 2=%d\n",b);
printf("\n");
tukar_angka(&a, &b);

printf("Setelah Pertukaran Angka:\n");
printf("\nNilai 1=%d\n",a);
printf("Nilai 2=%d\n",b);
printf("\n");

getch();
return 0;
}

0 komentar:

Poskan Komentar

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More