(b) 2, 5, 10, 17, wap to disply the first ten terms of the series
Answers
Answered by
0
Answer:
/* Program in C For Series 2 5 10 17 ...... upto nth term and sum too */
#include<stdio.h>
#include<conio.h>
void main()
{
int i,calc=0,num=0,sum=0;
printf("\n Enter any number :");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
calc=i*i+1;
printf(" %d ",calc);
sum=sum+calc;
}
printf("\n Sum = %d :",sum);
getch();
}
Similar questions
Physics,
6 months ago