Backup proyecto Joyfe - Borland
This commit is contained in:
27
CPP/EJEMPLO4.CPP
Normal file
27
CPP/EJEMPLO4.CPP
Normal file
@ -0,0 +1,27 @@
|
||||
// ejemplo4
|
||||
|
||||
#include<stdio.h>
|
||||
#include<conio.h>
|
||||
|
||||
int tabla[10][10],num,x,y,sw=1;
|
||||
void main(){
|
||||
clrscr();
|
||||
for (y=0,num=1;y<10;y++){
|
||||
if (sw==1)
|
||||
for (x=0;x<10;x++,num++){
|
||||
tabla[y][x]=num;
|
||||
printf ("\nValor de la posici<63>n [%d][%d] es: %d",y,x,tabla[y][x]);
|
||||
sw=0;
|
||||
}
|
||||
else
|
||||
for (x=9;x>=0;x--,num++){
|
||||
tabla[y][x]=num;
|
||||
printf ("\nValor de la posici<63>n [%d][%d] es: %d",y,x,tabla[y][x]);
|
||||
sw=1;
|
||||
}
|
||||
fflush(stdin);
|
||||
getch();
|
||||
}
|
||||
fflush(stdin);
|
||||
getch();
|
||||
}
|
||||
Reference in New Issue
Block a user