[ create a new paste ] login | about

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

C, pasted on Apr 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h>
#include<conio.h>

long Tong(int n)
{
	if(n == 0)
		return 0;
	return Tong(n - 1) + n;
}

int main()
{
	int n, S;
	printf("\Nhap n = "); scanf("%d", &n);

	S = Tong(n);
	printf("S = %d", S);

	getch();
	return 0;
}


Output:
1
2
Line 17: error: conio.h: No such file or directory
Line 8: warning: unknown escape sequence '\N'


Create a new paste based on this one


Comments: