[ create a new paste ] login | about

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

C, pasted on Sep 2:
#include<stdio.h>
#include<conio.h>

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

	s = 0;
	i = 1;
	while(i <= n)
	{
		s = s + i;
		i = i + 1;
	}
	printf("\n%ld", 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: