Write a q basic program to generate the following series 1 4 9 16 25 up to 10 terms
Answers
Answered by
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