Bài Giải
/*
Name: Mo phong phep chia nguyen
Copyright: None
Author: Tran Anh
Description: http://www.code.tavn.net
*/
/*
Name: Mo phong phep chia nguyen
Copyright: None
Author: Tran Anh
Date: 10/05/14 08:25
Description: http://tvlaptrinh.blogspot.com
*/
#include <stdio.h>
#include <conio.h>
main()
{
//Trang tri chuong trinh
int i;
printf("\t");
for (i=1;i<30;i++) printf("* ");
printf("\n\t\t CHUONG TRINH MO PHONG PHEP CHIA HET\n\n");
//Het doan chuong trinh trang tri
int a,b,hieu=0,lan=0;
printf(" -Nhap gia tri a= "); scanf("%d",&a);
printf(" -Nhap gia tri b= "); scanf("%d",&b);
hieu=a;
do
{
hieu=hieu-b;
lan++;
}
while (hieu>=b);
printf("\t=>Gia tri= %d",lan);
getch();
return 0;
}
Name: Mo phong phep chia nguyen
Copyright: None
Author: Tran Anh
Description: http://www.code.tavn.net
*/
/*
Name: Mo phong phep chia nguyen
Copyright: None
Author: Tran Anh
Date: 10/05/14 08:25
Description: http://tvlaptrinh.blogspot.com
*/
#include <stdio.h>
#include <conio.h>
main()
{
//Trang tri chuong trinh
int i;
printf("\t");
for (i=1;i<30;i++) printf("* ");
printf("\n\t\t CHUONG TRINH MO PHONG PHEP CHIA HET\n\n");
//Het doan chuong trinh trang tri
int a,b,hieu=0,lan=0;
printf(" -Nhap gia tri a= "); scanf("%d",&a);
printf(" -Nhap gia tri b= "); scanf("%d",&b);
hieu=a;
do
{
hieu=hieu-b;
lan++;
}
while (hieu>=b);
printf("\t=>Gia tri= %d",lan);
getch();
return 0;
}
Không có nhận xét nào:
Đăng nhận xét