View the step-by-step solution to:

00 Week 7 Quiz This question was created from FIN 100 Week 7 Quiz

This question was created from FIN 100 Week 7 Quiz https://www.coursehero.com/file/22157453/FIN-100-Week-7-Quiz/

22157453-184383.jpeg

(TCOs 6 and 8) Which is the output of the following C# code if the numbers input are 5 and then 5? static void Main(string[] args) { int n1, n2, temp; Console.Write("Enter a number: "); n1 = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter a number: "); n2 = Convert.ToInt32(Console.ReadLine()); temp = goofy(n1, n2); Console.WriteLine("The answer is " + temp); Console.ReadLine(); } public static int goofy(int x, int y) { int ans; if (x>y) { ans = 2 * (x-y); } else if (x<y) { ans = 2*(x+y); } else { ans = x+y; } return ans; } which is the correct answer? 10 60 20 30

22157453-184383.jpeg

Top Answer

The best way to approach your question... View the full answer

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask a homework question - tutors are online