[ create a new paste ] login | about

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

C, pasted on Aug 20:
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
	int i, n;
	float S;
	do
	{
		printf("\nNhap n(n >= 1): ");
		scanf("%d", &n);

		if(n < 1)
		{
			printf("\nn phai >= 1. Xin nhap lai !");
		}
	}while(n < 1);
	i = 1;
	S = pow(1.0, 1.0/2);
	while(i <= n)
	{
		S = pow((i + S) * 1.0, 1.0/(i + 1));
		i++;
	}
	printf("\nTong la %f", 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: