// cbai15.cpp : Defines the entry point for the console application.
//
#include"stdafx.h"
#include<stdio.h>
#include<conio.h>
voiddoicho(float *x, float*y)
{
floattg;
tg = *x;
*x = *y;
*y = tg;
}
int_tmain(int argc, _TCHAR* argv[])
{
floata,b;
printf("Nhap so thuc a: a = "); scanf("%f",&a);
printf("Nhap so thuc b: b = "); scanf("%f",&b);
printf("\nTruoc khi doi cho.\n a = %5.2f\n b = %5.2f ",a,b);
doicho(&a,&b);
printf("\nSau khi doi cho.\n a = %5.2f\n b = %5.2f",a,b);
getch();
return0;
}
No comments:
Post a Comment