Write a C Program to find the Sum of Square Terms using Goto

#include <stdio.h>
#include <conio.h>
void main()
{
int s=0,i=1,n;
printf("\nEnter The Last Term: ");
scanf("%d",&n);
l1: s=s+i*i;
i++;
if (i<=n)goto l1 ;
printf("\n Sum of Square numbers: %d",s);
getch();
}
Comments
Post a Comment