[ create a new paste ] login | about

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

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

int main()
{
	int i, n;
	long P;
	do
	{
	printf("\nNhap n(n > 0): ");
	scanf("%d", &n);
	  if(n <= 0)
	   {
		printf("\n N phai > 0. Xin nhap lai !");
	   }
	}while(n <= 0);
    i = 1;
    P = 1;
	printf("\nCac uoc so le cua so %d la: ",n);
	while(i <= n)
	{
		if(n % i == 0)
		{
			if(i % 2 == 1)
			{
			printf("%4d", i);
			P = P * i;
			}
		}
			i++;
	}
	printf("\nTich cac uoc so le cua %d la: %ld", n, P);

	getch();
	return 0;
}


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


Create a new paste based on this one


Comments: