Home » questions » help C++ experts can u make me a prog that inputs 10 int numbers then displays the highest and lowes

help C++ experts can u make me a prog that inputs 10 int numbers then displays the highest and lowes

2006-08-07 10:04:29, Category: Programming & Design
computes the ave of the lowest and highest numbers

Answers

  1. p0

    On 2006-08-07 10:21:35


    anyone can write a simple progran like that, the question is, can you do it in O(log(n)) time? Steve S - Good one!
  2. Steve S

    On 2006-08-07 10:32:58


    Off the top of my head include main{ int[10] n; cout << "enter ten numbers" << endl; for (int i = 0; i < 10; i+=2) { cin >> n[i] } int biggest = 99999, littlest = -999999; for (int j = 0; j < 10; j++) { if n[j] < littlest littlest = n[j] else if n[j] < biggest biggest = n[j] } int avg = biggest + littlest /2; cout << avg >> endl; }
  3. D

    On 2006-08-07 10:09:26


    yes, yes I can. Actually you know I was assigned to do the same assignment in my class, so no, no I wont. My services don't come free, you pay like everyone else. BTW, it really doesn't take an expert to make a program that is that simple.
  4. griz803

    On 2006-08-08 09:53:14


    And you think I should do the learning for you why? And who will be there to do your work after graduation so you can file your nails, surf the web and pick up your paychecks for nothing? Do it yourself.
  5. uscmedguy

    On 2006-08-07 11:11:07


    C'mon man do your own homework
  6. TruthIsGod

    On 2006-08-07 11:37:15


    the question is too difficult for an ordinary c++ expert. try mailing it to bill gates