Printf and return functions synonymous? › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2: [Arrays] – Functions, Variable and Scope, Debugging, Arrays, and Command Line Arguments › Printf and return functions synonymous? Tagged: c, data type, printf, return, return value, returning values, scrabble lab problem, value returned by function This topic has 0 replies, 1 voice, and was last updated December 11, 2021 at 7:32 am by admin. Viewing 1 post (of 1 total) Author Posts December 11, 2021 at 7:32 am #65 adminKeymaster [dm_code_snippet background=”yes” background-mobile=”no” slim=”yes” line-numbers=”yes” bg-color=”#abb8c3″ theme=”dark” language=”clike” wrapped=”yes” height=”” copy-text=”Copy Code” copy-confirmed=”Copied”] 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!"; } [/dm_code_snippet] Using printf: [dm_code_snippet background=”yes” background-mobile=”no” slim=”yes” line-numbers=”yes” bg-color=”#abb8c3″ theme=”dark” language=”clike” wrapped=”yes” height=”” copy-text=”Copy Code” copy-confirmed=”Copied”] if (score1 > score2) { printf ("player1 winner"); } if (score2 > score1) { printf ("player2 winner"); } else { printf ("tie"); } [/dm_code_snippet] Are return and printf functions synonymous? Reply https://edstem.org/us/courses/176/discussion/933883?answer=2123080[learn_press_profile] Author Posts Viewing 1 post (of 1 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In Log in / Register