#include<math.h>
#include<stdio.h>
#include<conio.h>
void main()
{ clrscr();
int
n,sum=0,i,x[500];
printf("Enter
the power limit of 3=");
scanf("%d",&n);
for(i=0;i<=n;i++)
x[i]=pow(3,i);
for(i=0;i<=n;i++)
{printf("
%d",x[i]);}
for(i=0;i<=n;i++)
sum=sum+x[i];
printf("\nsummetion=%d",sum);
getch();
}
No comments:
Post a Comment
Please comment bellow. Share your knowledge