[ create a new paste ] login | about

Link: http://codepad.org/LBFS9K1U    [ raw code | output | fork ]

C, pasted on Aug 21:
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
	long themang, n;
	int sochuso;
	float S = 0;
	do
	{
	printf("\nNhap n: ");
	scanf("%ld", &n);
	}while(n < 0 && printf("\nLoi: n >= 0 !"));
	sochuso = 0;
	themang = n;

	while(themang != 0)
	{
		if(themang % 2 == 0)
		{
		S = S + themang % 10;
		}
		themang = themang / 10;
	}
	printf("\nTong cac chu so chan cua %ld la %f", n, S);

	

	getch();
	return 0;
}


Output:
1
Line 17: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: