string find_winner(int score1, int score2)
{
if (score1 > score2)
{
return "Player 1 wins!";
}
else if (score2 > score1)
{
return "Player 2 wins!";
}
else
{
return "Tie!";
}
Using printf:
if (score1 > score2)
{
printf ("player1 winner");
}
if (score2 > score1)
{
printf ("player2 winner");
}
else
{
printf ("tie");
}
Are return and printf functions synonymous?
Reply
https://edstem.org/us/courses/176/discussion/933883?answer=2123080[learn_press_profile]