kiem tien, kiem tien online, kiem tien truc tuyen, kiem tien tren mang
Monday, September 29, 2014

tính tổng các chữ số của 1 số nguyên bất kì nhập từ bàn phím trong lập trình c

#include"stdio.h"
#include"conio.h"
void main()
{
int s=0, n;
printf("nhap so nguyen: ");
scanf_s("%d", &n);
while (n % 10 != 0)
{
s += n % 10;
n /= 10;
}
printf("tong cac chu so la: %d", s);
_getch();
}
hình ảnh trong chương trình tính tổng các chữ số của 1 sô nguyen trong lập trình c

29 Sep 2014

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

domain, domain name, premium domain name for sales

Popular Posts