Like Tree3Likes
  • 3 Post By Salem

Hepl again!!

This is a discussion on Hepl again!! within the C++ Programming forums, part of the General Programming Boards category; Hello, I have some problem with a project that wants to find the three bigger numbers in a table of ...

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    4

    Exclamation Hepl again!!

    Hello,
    I have some problem with a project that wants to find the three bigger numbers in a table of ten numbers.I find the biggest number but i can't think the logical function to find the other two.
    i wrote this code
    for (i = 0; i < LIM; i++)
    cout<<table[i]<<" ";
    max = table[0];
    max1=table[0];
    max2=table[0];
    for (i = 0; i < LIM; i++n)
    if (table[i] > max)
    max = table[i];
    for (i = 0; i < LIM; i++)
    if(max>max1)
    max1=table[i];
    for (i = 0; i < LIM; i++)
    if(max1>max2)
    max2=table[i];
    cout << endl<<endl;





    but is definitely wrong :0
    Thanks in advance!!!
    Last edited by Jay Ret; 01-10-2012 at 12:56 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,752
    Well what is missing are all the braces you've removed from your code in order to avoid you having to use [code][/code] tags.

    A novel approach to be sure, but utterly useless in conveying what your code actually does.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    4
    You mean that i have done a synax error??I think that all the fuction is wrong.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,901
    It means that you post your real code and use code tags.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can anybody hepl?
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-02-2002, 10:02 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21