#include<iostream>
using namespace std;
#include<iomanip>
using std::setw ;
int main()
{
int a[15]; //array size 15
// inlize the elements of array n to 0
for(int i=1;i<=10;i++)
{
a[i]=i*2; //twic the element
}
cout<<"\t TABLE OF TWO"<<endl;
for(int j=1;j<=10;j++)
{ //output of each array elements value
cout<<setw(7)<<"2*"<<j<<"="<<setw(10)<<a[j]<<endl;
//setw used to formating the value
}
return 0;
}
No comments:
Post a Comment