A program to display the following series:

                            11,  22,  33,  44

without including the header file <math.h>.

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
int i,j,prod;

for(i=1;i<=4;i++)
{
prod=1;
for(j=1;j<=i;j++)
prod=prod*i;
cout<<prod<<" ";
}

getch();
}

 

< Back