TEMA

5% wrong answer

Monsur milton preguntado 9 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;

}

Recuerda no enviar soluciones. Tu mensaje puede ser revisado por nuestros moderadores.

  • feodorv respondido 9 months ago

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

                printf("I=%.0f J=%.0f\n",i,i+j);
  • RASED respondido 4 months ago

    you can try using int variables for the loop and double for printing the numbers.

  • Monsur milton respondido 9 months ago

    nope,still showing 5% wa