sum of first 50 number using goto c program, c program to find sum of first 50 number using goto
#include"stdio.h"
#include"conio.h"
void main()
{
int no=1,sum=0;
clrscr();
LABEL:
if(no<51)
{
sum=sum+no;
no++;
goto LABEL;
}
printf("The sum of first 50 number is= %d",sum);
getch();
}
#include"conio.h"
void main()
{
int no=1,sum=0;
clrscr();
LABEL:
if(no<51)
{
sum=sum+no;
no++;
goto LABEL;
}
printf("The sum of first 50 number is= %d",sum);
getch();
}