Thread: help needed in question solving!!!

  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    103

    help needed in question solving!!!

    i need some help regarding some questions of type :-
    find the output of the given code.
    find the errors in the given code/fragment
    i want to know the tricks to solve these kind of questions

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    Hmm, you pass them to a compiler and see!

    Now besides joking, it's all about habit. If you haven't "burnt" yourself with these or similar errors before it'll be easier to miss them. I find myself saying "How could I have possibly miss that?!" but it still happens. It's like grammar, you have to know how it works and have already used it in order to spot mistakes in someone else's text.
    About the output, you follow the flow of execution, like the PC would do. Flow charts are much easier to do this with, because their flow is pretty obvious. C++ code on the other hand can be a bit tricky if you aren't accustomed with it. I personally see the code as a flow chart directly, but you could be converting a line at a time for starters.
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    i know all that but i need tricks to boost my skills in these types of questions!!! any suggestions???

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There is no universal solution. You just have to experience problems and solve them.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    NO UNIVERSAL SOLUTION then O K its fine i'll go with some tips(useful ones) any tips???

  6. #6
    spaghetticode
    Guest
    You want useful advice, you get useful advice:

    1. Drink a lot.
    2. Open the window regularly to get fresh air.
    3. Stand up and move around every now and then.
    4. Get an ocassional break to reset your mind.

    What tricks could possibly exist? This is not magic, it's a skill, like skiing, cooking, or building tourist attraction models with LEGO bricks. The only trick ist practice, practice, practice. Gaining experience. Nothing to boost up there.

  7. #7
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    Quote Originally Posted by dennis.cpp View Post
    What tricks could possibly exist? This is not magic, it's a skill, like skiing, cooking, or building tourist attraction models with LEGO bricks. The only trick ist practice, practice, practice. Gaining experience. Nothing to boost up there.
    but.....
    i say "by only practicing is not the solution to get skills,practicing in right direction helps getting skill and knowledge provides the direction"

    so i want some tricks to solve tricky questions and tips to boost up my skills

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,412
    Quote Originally Posted by Mukul Kumar
    find the output of the given code.
    find the errors in the given code/fragment
    i want to know the tricks to solve these kind of questions
    There are no tricks for these. There is only skill, which is obtained through practice.

    Back when I was a first year university student, I became known among my computing classmates for my uncanny ability to tell them what they did wrong without even looking at their code, just by a glance at the error message from their Java compiler. Magic? A trick? Hardly. I could do such wizardry because once upon a time, I made the same mistake and got the same compile error. That, coupled with my knowledge of the programming question that they were trying to solve, allowed me to diagnose their code's problem without actually reviewing it.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Would it be inappropriate to create a second account just I could like that post again?

    Soma

  10. #10
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    Quote Originally Posted by laserlight View Post
    Back when I was a first year university student, I became known among my computing classmates for my uncanny ability to tell them what they did wrong without even looking at their code, just by a glance at the error message from their Java compiler.
    same is with me with my school-mates

  11. #11
    Registered User
    Join Date
    Jun 2012
    Location
    Morden, UK
    Posts
    128
    ...and here's me doing programming day after day in my own time, trying to create/solve different problems, toiling away trying to get better, when all I actually need to do is follow this thread and wait for the 'tricks' to be revealed! Can't wait

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simplifying Numerical Solving before actual solving
    By Vespasian in forum Tech Board
    Replies: 3
    Last Post: 10-14-2012, 11:39 AM
  2. Need help solving this C programming question
    By C-user in forum C Programming
    Replies: 23
    Last Post: 10-20-2011, 02:39 AM
  3. Solving a Maze in C, Help needed
    By Krote in forum C++ Programming
    Replies: 2
    Last Post: 06-22-2011, 10:32 PM
  4. Solving a Maze in C++. URGENT Help Needed :)
    By Krote in forum C Programming
    Replies: 5
    Last Post: 06-21-2011, 05:58 PM
  5. Help solving a question
    By everyone0 in forum C Programming
    Replies: 9
    Last Post: 05-06-2010, 11:09 AM