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
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
I've known my problem. Thank you!
Last edit: Tuan Anh 2021-06-22
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:
--
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
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:
--
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
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);