ciclo for
como hago una tabla que me muestre los dobles de cada num
0
1
2
4
8
16
32
64
¿?
0
1
2
4
8
16
32
64
¿?
// program dobles.cpp
// 17/3/2006
// wtitten in borland c++, ver 4.52
#include <iostream.h>
#include <iomanip.h>
int main()
{
cout << setw(10) << 0 << endl; // el cero no pertenece a la serie de dobles
for(unsigned int n = 1;n < 17000;n = 2*n)
cout << setw(10) << n << endl;
cout << endl << "end of program, good bye ! ! !" << endl;
return 0;
}
// 17/3/2006
// wtitten in borland c++, ver 4.52
#include <iostream.h>
#include <iomanip.h>
int main()
{
cout << setw(10) << 0 << endl; // el cero no pertenece a la serie de dobles
for(unsigned int n = 1;n < 17000;n = 2*n)
cout << setw(10) << n << endl;
cout << endl << "end of program, good bye ! ! !" << endl;
return 0;
}
