TOPIC

why wrong answer 10%?

CSE_19_Masrafi Bin Seraj asked 1 month ago

include

main() { int i,x,t,y,sum=0; for(;1;) { scanf("%d %d",&x,&y); if(x<=0 || y<=0) { break; } else {

if(x>y)
{
    t=x;
    x=y;
    y=t;
}
for(i=x;i<=y;i++)
    {
        printf("%d ",i);
        sum=sum+i;
    }

    printf("Sum=%d\n",sum);

}
}

}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.