TOPIC

5% wrong answer

Monsur milton asked 3 months ago

What's the error here ? can someone point it out ?

include

int main() { double i,j;

for(i=0;i<=2;i=i+0.2)
{
    for(j=1;j<=3;j++)
    {
        if(i==0 || i==1 || i>=1.9)
            printf("I=%.lf J=%.lf\n",i,i+j);
        else
            printf("I=%.1lf J=%.1lf\n",i,i+j);

    }
}

return 0;

}

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

  • feodorv replied 3 months ago

    I didn't use double values in my solution. You can try

                printf("I=%.0f J=%.0f\n",i,i+j);
  • Monsur milton replied 2 months ago

    nope,still showing 5% wa