Menu

Do you know what is this problem ?

Tuan Anh
2021-06-22
2021-06-23
  • Tuan Anh

    Tuan Anh - 2021-06-22

    I've known my problem. Thank you!

     

    Last edit: Tuan Anh 2021-06-22
    • Ricardo Luiz Barros de Freitas

      You printed a, b, c and d without value.

      the correct code:

      int max, max1, max2;
      int a, b, c, d;
      max1 = a;
      max2 = c;
      printf ("Enter a: ");
      fflush(stdin);
      scanf ("%d", &a);
      fflush(stdin);
      printf ("\nEnter b: ");
      scanf ("%d", &b);
      printf ("\nEnter c: ");
      fflush(stdin);
      scanf ("%d", &c);
      printf ("Enter d: ");
      fflush(stdin);
      scanf ("%d", &d);

      Em ter., 22 de jun. de 2021 às 00:34, Tuan Anh anhtuan487@users.sourceforge.net escreveu:

      The code:

      int max, max1, max2;
      int a, b, c, d;
      max1 = a;
      max2 = c;printf ("Enter a: %d", a);scanf ("%d", &a);printf ("Enter b: %d", b);scanf ("%d", &b);printf ("Enter c: %d", c);scanf ("%d", &c);printf ("Enter d: %d", d);scanf ("%d", &d);

      When I run it, there are some numbers auto show up in front of the the
      input. What does it mean ? It also makes the program run incorrect


      Do you know what is this problem ?
      https://sourceforge.net/p/orwelldevcpp/forums/troubleshooting/thread/81764f8a7a/?limit=25#6bd1


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/orwelldevcpp/forums/troubleshooting/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --


      Ricardo Luiz Barros de Freitas
      Professor Adjunto Doutor
      Universidade Estadual do Oeste do Paraná - CECE - PTI
      Av. Tancredo Neves, 6731 - sala 1 - Espaço 1 - Bloco 5
      Parque Tecnológico Itaipu - PTI - Foz do Iguaçu / PR
      Cel.: (55)(45)99998-5674

       
    • Ricardo Luiz Barros de Freitas

      You printed a, b, c and d without value.
      You can not give values to max1 and max2 if the variables do not have
      values.

      the correct code:

      int max, max1, max2;
      int a, b, c, d;
      // max1 = a;
      //max2 = c;
      printf ("Enter a: ");
      fflush(stdin);
      scanf ("%d", &a);
      fflush(stdin);
      printf ("\nEnter b: ");
      scanf ("%d", &b);
      printf ("\nEnter c: ");
      fflush(stdin);
      scanf ("%d", &c);
      printf ("Enter d: ");
      fflush(stdin);
      scanf ("%d", &d);

      Em ter., 22 de jun. de 2021 às 00:34, Tuan Anh anhtuan487@users.sourceforge.net escreveu:

      The code:

      int max, max1, max2;
      int a, b, c, d;
      max1 = a;
      max2 = c;printf ("Enter a: %d", a);scanf ("%d", &a);printf ("Enter b: %d", b);scanf ("%d", &b);printf ("Enter c: %d", c);scanf ("%d", &c);printf ("Enter d: %d", d);scanf ("%d", &d);

      When I run it, there are some numbers auto show up in front of the the
      input. What does it mean ? It also makes the program run incorrect


      Do you know what is this problem ?
      https://sourceforge.net/p/orwelldevcpp/forums/troubleshooting/thread/81764f8a7a/?limit=25#6bd1


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/orwelldevcpp/forums/troubleshooting/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --


      Ricardo Luiz Barros de Freitas
      Professor Adjunto Doutor
      Universidade Estadual do Oeste do Paraná - CECE - PTI
      Av. Tancredo Neves, 6731 - sala 1 - Espaço 1 - Bloco 5
      Parque Tecnológico Itaipu - PTI - Foz do Iguaçu / PR
      Cel.: (55)(45)99998-5674

       
  • Ricardo Luiz Barros de Freitas

    You printed a, b, c and d without value.
    You can not give values to max1 and max2 if the variables do not have values.

    the correct code:

    int max, max1, max2;
    int a, b, c, d;
    // max1 = a;
    //max2 = c;
    printf ("Enter a: ");
    fflush(stdin);
    scanf ("%d", &a);
    fflush(stdin);
    printf ("\nEnter b: ");
    scanf ("%d", &b);
    printf ("\nEnter c: ");
    fflush(stdin);
    scanf ("%d", &c);
    printf ("Enter d: ");
    fflush(stdin);
    scanf ("%d", &d);

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.