Need a small help from you guys, fast !

Discussion in 'Programming' started by zelos, Aug 7, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Hi guys, I need some help here. I am new to C++ programming and I face problems writing this code.The questions is : Prompt users to enter 1000 integers ,then find the biggest integer among the numbers. Only use if-else statement and looping.


    Thanks guys. I appreciate a lot if you all can post the code here.
     
    zelos, Aug 7, 2007 IP
  2. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hint...

    its a for next loop, starting at 1, terminating when greater than 1000...
    
    int max=0;
    for(int i=0;i<1001;i++){
       int current=getThenumberFromTheConsole();
       if(current>max){
          max=current;
       }
    }
    outputTheMaxToConsole(max);
    
    Code (markup):
    That's not C code but it should give you enough to finish your homework!

    }
     
    ecentricNick, Aug 7, 2007 IP
  3. zelos

    zelos Peon

    Messages:
    445
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks ecentricNick, I am very new in programming and I don't quite understand the code above, I needed a c++ code. can anyone provide an exact answer to the statement? A full C++ code. Thanks.


    Thanks ecentricNick.
     
    zelos, Aug 7, 2007 IP
Thread Status:
Not open for further replies.