Computer Science, asked by vinodkygmailcom7705, 1 year ago

Write a q basic program to generate the following series 1 4 9 16 25 up to 10 terms

Answers

Answered by ramesh87901
0



#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("Enter the last number in the series");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("\n%d",i*i);
}
getch();
}

Output:

Enter the last number in the series: 3

1
4
9

Similar questions