Popular Posts

26.Write a program to find the power series of n .

26.Write a program to find the power series of n .


#include
#include
#include
int main()
{
clrscr();
int i,n,a[10];
cout<<"Input: "; cin>>n;
cout<<"Output: ";
for(i=0;i<10;i++)
{
a[i]=pow(n,i);
cout< }
getch();
return 0;
}

Output:

Input: 2
Output: 1 2 4 8 16 32 64 128 256 512

No comments: