2
The program I made compiles, but what is requested does not appear on the screen. That’s the thing about:
Construct an algorithm in PORTUGOL, which receives three values, A, B and C, and store them in three variables with the following names: MAJOR, INTER and MINOR (the names correspond to the ordered values).
#include <stdio.h>
#include <stdlib.h>
main()
{
float a,b,c,maior,menor,inter;
printf("\n Digite o primeiro valor:");
scanf("%f",&a);
printf("\n Digite o segundo valor:");
scanf("%f",&b);
printf("\n Digite o terceiro valor:");
scanf("%f",&c);
if((a<b)&&(a<c))
{
menor=a;
}
if(b<c)
{
inter=b;
maior=c;
}
else
{
inter=c;
maior=b;
}
if((b<a)&&(b<c))
{
menor=b;
}
if(a<c)
{
inter=a;
maior=c;
}
else
{
inter=c;
maior=a;
}
if((c<a)&&(c<b))
{
menor=c;
}
if(a<b)
{
inter=a;
maior=b;
}
else
{
inter=b;
maior=a;
}
system("pause");
return 0;
}
"What is asked" is to enter the values, that does not appear on the screen? Or the results? Something else, why in C if the statement loses Portugol?
– bfavaretto
The results do not appear and I did in portugol and ran in visualg, but when I passed to C no result appeared. Appears what is requested in the printf, but not the results.
– rafael gomes cardoso
It is that you define the values of the variables, but at no time print! Search on the command
printf
of the C.– bfavaretto
I get it. Thank you.
– rafael gomes cardoso