[ create a new paste ] login | about

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

C, pasted on Feb 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//BuiQuachThinh_CE140426
//Date: 17/02/2020
//Xu ly chuong trinh in ra man hinh tam giac so n dong
#include<stdio.h>
int main()
{
    int n;// khai bao bien
    printf("Nhap gia tri n:  ");
    scanf("%d",&n);

    for(int t = 1; t <= n; t++) // kiem tra ddieu kien cua n
    {
        for(int m = 1; m <= t; m++)
        {
            printf("%d",m);
        }
        printf("\n"); // xuong dong
    }
    // In ra man hinh gia tri theo n có hinh mot tam giac vuong
}


Output:
1
2
3
In function 'main':
Line 11: error: 'for' loop initial declaration used outside C99 mode
Line 13: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: