hi,
this code prints out numbers like so.
1 2 (there should be a 25 space gap)
3 4
5 6 etc.
but i am not happy with my method of doing it . Could anyone show me a better alternative.
code.
#include <iostream>
#include <iomanip> // for use of set(x)
using namespace std;
int main ()
{
int count=1;
int num=0;
for(count = 1; count <= 20;count++)
{
num +=1;
cout << setw(3) << num ;
num +=1;
cout << setw(25) << num <<endl;
}
cout << endl;
return 0;
}
thanks



LinkBack URL
About LinkBacks


