Coding-
#include<stdio.h>
#include<conio.h>
void main()
{
int i, s=0;
for(i=1; i<=10; i++)
{
s=s+i;
if(i==5)
goto start;
}
start:
printf("Sum of=%d",s);
getch();
}
OUTPUT-
sum of 15
#include<stdio.h>
#include<conio.h>
void main()
{
int i, s=0;
for(i=1; i<=10; i++)
{
s=s+i;
if(i==5)
goto start;
}
start:
printf("Sum of=%d",s);
getch();
}
OUTPUT-
sum of 15
Comments
Post a Comment
Please Subscribe and Comments my blog site.