[ create a new paste ] login | about

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

C, pasted on Aug 22:
#include<stdio.h>
#include<conio.h>

int main()
{

	int n;
	do
	{
		printf("\nNhap n(n >= 0): ");
		scanf("%d", &n);
		if(n < 0)
		{
			printf("\nN phai >= 0. Xin nhap lai !"); 
		}
	}while(n < 0);

	
	printf("\nSo %d gom toan cac chu so chan hay khong ?\n", n);
	bool Check = true;
	while(n /= 10)
	{
		if((n % 10) % 2 == 1)
		{
			Check = false;
		    break;
		}
	}
	if(Check == true)
	{
		printf("Dung !");
	}
	else
	{
		printf("Sai");
	}
	getch();
	return 0;
}


Output:
1
2
3
4
5
6
7
8
9
Line 17: error: conio.h: No such file or directory
In function 'main':
Line 20: error: 'bool' undeclared (first use in this function)
Line 20: error: (Each undeclared identifier is reported only once
Line 20: error: for each function it appears in.)
Line 20: error: expected ';' before 'Check'
Line 25: error: 'Check' undeclared (first use in this function)
Line 25: error: 'false' undeclared (first use in this function)
Line 29: error: 'true' undeclared (first use in this function)


Create a new paste based on this one


Comments: