DEV_BUT1/DEV1.1/TP09/progression.c

63 lines
1.1 KiB
C
Raw Normal View History

2022-10-18 14:50:36 +02:00
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
int main()
{
int t1 [2][5];
int i;
int a;
int c = 0;
for(a=0; a<2; a++){
for(i=1; i<=5; i++){
t1[c][i] = i;
printf("[%d]", t1[c][i]);
}
c++;
printf("\n");
}
printf("\n");
printf("\n");
int t2 [3][5];
int g;
int r;
int z=1;
int e = 0;
for(r=0; r<3; r++){
for(g=0; g<5; g++){
t2[e][g] = z;
printf("[%d]", t2[e][g]);
z++;
}
printf("\n");
e++ ;
}
printf("\n");
printf("\n");
int be;
int ba;
int acc = 0;
int bouc;
int t3[5][5];
for(be=0; be<5; be++){
for(ba=0; ba<5; ba++){
if (ba >= be){
t3[be][ba] = 0;
}
else{
t3[be][ba] = ba+1;
}
printf("[%d]", t3[be][ba]);
}
printf("\n");
}
return 0;
}