Home » , » Program C++ Tukar Bilangan

Program C++ Tukar Bilangan

Posted by Jurang007

berikut program tukar bilangan dengan menggunakan c++ .


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

void Tukar_Bilangan (int *bil_a,int *bil_b);

void main ()

{
        int bil_a;
        int bil_b;

        printf ("Masukan Bilangan A= "); scanf("%d", &bil_a);
        printf ("Masukkan bilangan B= "); scanf ("%d", &bil_b);
        printf ("n");

        Tukar_Bilangan (&bil_a,&bil_b);

        printf ("Bilangan a Sekarang = %d", bil_a);
        printf ("n");
        printf ( "Bilangan B Sekarang = %d", bil_b);
        printf ("n");

}


void Tukar_Bilangan (int *bil_a, int *bil_b)

{
        int temp;
        temp= *bil_a;
        *bil_a=*bil_b;
        *bil_b=temp;

}


semoga bermanfaat....


0 komentar:

Post a Comment

Popular Posts

Followers

Blog Archive