47. Series 5

Image result for c programming
Code:
  #include<stdio.h>
int main(){
  int n,i,j=3;
  scanf("%d",&n);
  for (i=1;i<=n;i++)
  {
    printf("%d ",j);
    j=j*3;
  }
  return 0;
}

No comments