#include<stdio.h>
void
main()
{
int
i, n, sqr=0;
clrscr();
printf("Enter
the value of n:");
scanf("%d",
&n);
printf("Squares
of first %d natural numbers = %d", n, sqr);
for(i=1;
i<=n; i++)
{
sqr=i*i;
printf("%d\n",sqr);
}
getch();
}
No comments:
Post a Comment