Tuesday, 5 September 2017

Write a program to generate the series 2 15 41 80 132 197 275 366 470 587



 #include<stdio.h>

 int main()
 {
 int i,j=2,n;
 scanf("%d",&n);
 for(i=1;i<=n;i++)
 {
 printf("%d ",j);
 j=j+(13*i);
 }
 return(0);
 }

No comments:

Post a Comment