Write a program to find the series upto 10 terms:
2,5,17.........
Answers
Answered by
1
Answer:
#include<stdio.h>
int main()
{
int s=1, n, d=1, i=1, ans=0;
printf("Enter number of terms\n");
scanf ("%d",&n);
printf("\n The series is: \n");
do
{
printf("%d \t",s);
ans = ans+s;
s = s + d;
d = d + 2;
i = i + 1;
} while (i<=n);
printf ("\n The sum of the series is %d", ans);
return 0;
}
Explanation:
Hope the above answer helps you. The above answer contains the correct information about your question. Please mark my answer as the brainliest and say thanks for the answer. Follow me
Answered by
8
import java.util.*;
public class Series
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int m,n;
for(m=1;m<=10;m++)
{
n=Math.pow(m,2)+1;
System.out.println("Display the series"+n);
}
}
}
Similar questions