[ create a new paste ] login | about

Link: http://codepad.org/CP0kfhzn    [ 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
19
20
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.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 7: error: 'for' loop initial declaration used outside C99 mode
In function 'max':
Line 16: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: