utiliza el do while
Publicado por juan (3 intervenciones) el 22/10/2020 07:42:44
necesito realizar este programa con el do while y quitar el for
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdlib.h>
#include <iostream>
using namespace std;
int matriz [2][3];
int valor, i, j, sum;
mail()
{
cout<<"PROGRAM THAT SHOW AN ARRAY 5X5\n\n"<<endl;
system("color B0");
for(i=0;i<3;i++)
{
for(j=0; j<4;j++)
{
cout<<"insert the value of tha array in the position["<<i<<","<<j<<"]:";
cin>>valor;
matriz[i][j] = valor;
}
}
for(i=0;i<3;i++)
{
cout<<"|";
for(j=0; j<4;j++)
{
cout<<"\t"<<matriz [i][j]<<"\t";
}
cout<<"|"<<endl;
}
system("PAUSE");
}
Valora esta pregunta
0