Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

UnkleRhaukus Group Title

.c code

  • 5 months ago
  • 5 months ago

  • This Question is Closed
  1. UnkleRhaukus Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    This is one of my first programs in c can it be simplified? improved? is there someway to get the correct and incorrect paths to be nearer to each other in the code?

    • 5 months ago
  2. UnkleRhaukus Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    • 5 months ago
    1 Attachment
  3. e.mccormick Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    To be honest, there is generally going to be better input verification. This would not simply things, but prevents issues caused by input that is designed to be harmful. Also, a lot of what makes C, and many other languages, more powerful is the use of functions or sub routines. As you go on, you will learn about those and how they can make programs more flexible and efficient.

    • 5 months ago
  4. wio Group Title
    Best Response
    You've already chosen the best response.
    Medals 1

    There is one way you can really simplify the code. Change ``` if ( condition ) { print( correct answer ); remaining program } else { print( wrong answer ); } ``` To ``` if ( condition ) { print( correct answer ); } else { print( wrong answer ); return 0; } remaining program ``` This will prevent nesting and make the flow or your program much more linear. Another thing you should do is implement functions.

    • 5 months ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.