0
Where should I post a question regarding code coach challenge in SoloLearn?
I'm getting the output in Code Playground but gets failed case in the code coach challenge! ? Why ?
10 Antworten
+ 1
Try to post in single reply...
Description says..
2cents equal to dollar so 2p:1d
Peso*2/100 is equal to Dollar..
And your code not including when 2 equal value so write <= instead of <.
Edit:
The multiplication may result in overflow.. So use division..
+ 1
Where should I post a question regarding code coach challenge in SoloLearn?
I'm getting the output in Code Playground but gets failed case in the code coach challenge! ? Why ?
0
Here,
you can ask with your tried code which is giving you trouble with enough details..
Add link of your tried code..
0
Okay
0
It's on c and a try solution for Argentina easy
0
#include <stdio.h>
int main()
{
int priceIn_Peso;
int priceIn_Dollars;
int convertedValue;
scanf("%d",&priceIn_Peso);
scanf("%d", &priceIn_Dollars);
convertedValue = priceIn_Peso / priceIn_Dollars* 2;
if (convertedValue < priceIn_Dollars)
{
printf("Pesos");
}
else if (convertedValue > priceIn_Dollars )
{
printf("Dollars");
}
return 0;
}
0
Finally it got solved thank you so much once again !!
#include <stdio.h>
int main()
{
int priceIn_Peso;
int priceIn_Dollars;
int convertedValue;
scanf("%d",&priceIn_Peso);
scanf("%d", &priceIn_Dollars);
convertedValue = (priceIn_Peso * 2)/100;
if (convertedValue <= priceIn_Dollars)
{
printf("Pesos");
}
else if (convertedValue > priceIn_Dollars )
{
printf("Dollars");
}
return 0;
}
0
You're welcome..
0
Okay what was the code coach challenge?