[ create a new paste ] login | about

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

C, pasted on Apr 21:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>
#include<conio.h>
void main()
{
	int n, S = 0, m, a;
	printf("Nhap vao so luong phan tu: ");
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
	{
		printf("Nhap phan tu thu %d: ", i);
		scanf("%d", &a);
		S = S + a;

	}
	printf("Nhap vao so M: ");
	scanf("%d", &m);
	printf("Ket qua la: %d", S%m);
	getch();
}


Output:
1
2
3
4
Line 17: error: conio.h: No such file or directory
In function 'main':
Line 8: error: 'for' loop initial declaration used outside C99 mode
Line 4: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: