[ create a new paste ] login | about

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

C, pasted on Oct 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
 
void nhap(int a[], int n)
{
    for (int i = 1; i < n; i++)
    {
        printf("Nhap vao phan tu a[%d]: ", i);
        scanf("%d", &a[i]);
    }
}
int max(int a[], int n)
{
    int max = a[0];
    for (int i = 1; i < n; i++)
        if (max < a[i])
            max = a[i];
    return max;
}


Output:
1
2
3
4
In function 'nhap':
Line 5: error: 'for' loop initial declaration used outside C99 mode
In function 'max':
Line 14: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: