Thread: How to write this program by using C++

  1. #1
    Registered User
    Join Date
    Nov 2017
    Posts
    22

    How to write this program by using C++

    Read the input numbers were given in a txt file and find out the maximum number, minimum number and the sum of those input numbers were given in that file as output by using C++ Programming in simple way.(File Input and Output mode).

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    We won't solve your homework for you. Try solving it by yourself, and if you get stuck we might help.
    Devoted my life to programming...

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Read this:
    A development process

    The basic rule is 'start small, compile and test often'.

    The valuable skill to learn is how to break the problem down into manageable steps.
    > Read the input numbers were given in a txt file and find out the maximum number, minimum number and the sum of those input numbers were given in that file

    So for example
    1. You read the numbers and just print what's in the file. There's no point having a text file with 123 in it, if you end up printing 456 or "I'm a banana", because any other code you have will just produce garbage.

    2. The program from step 1, with 'print the max'.

    3. The program from step 2, with 'print the min'.

    Do you see where this is going?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 10-09-2014, 09:20 PM
  2. Replies: 9
    Last Post: 09-09-2014, 08:23 AM
  3. How to write a program for...
    By babyboy in forum C Programming
    Replies: 20
    Last Post: 02-19-2008, 06:01 AM
  4. How to write a program for...
    By babyboy in forum C Programming
    Replies: 6
    Last Post: 02-15-2008, 06:17 AM
  5. I need to write a program !!!
    By alone2002dj in forum C Programming
    Replies: 2
    Last Post: 12-12-2007, 01:22 AM

Tags for this Thread