[ create a new paste ] login | about

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

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

int main()
{
	int i, n;
	printf("\nNhap n: ");
	scanf("%d", &n);

	if(n < 2)
		printf("\nSo %d khong phai la so nguyen to", n);
	else if(n == 2)
		printf("\nSo %d la so nguyen to", n);
	else if(n % 2 == 0)
		printf("\nSo %d khong phai la so nguyen to", n);
	else
	{
		for(i = 3; i <= n; i+=2)
		{
			if(n % i == 0)
				break;
		}
		if(i == n)
			printf("\nSo %d la so nguyen to", n);
		else
			printf("\nSo %d khong phai la so nguyen to", n);
	}
		


	getch();
	return 0;
}


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


Create a new paste based on this one


Comments: