Help about some program

This is a discussion on Help about some program within the C Programming forums, part of the General Programming Boards category; Help needed about two programs using functions: Selection sorting and remove all spaces from a string. thanx....

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    2

    Arrow Help about some program

    Help needed about two programs using functions:
    Selection sorting and remove all spaces from a string.
    thanx.

  2. #2
    Making mistakes
    Join Date
    Dec 2008
    Posts
    476
    WE won't do your homework for you. It looks like an assignment.

  3. #3
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by gourab View Post
    Help needed about two programs using functions:
    Selection sorting and remove all spaces from a string.
    thanx.
    What have you done so far?
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    2
    Quote Originally Posted by Brafil View Post
    WE won't do your homework for you. It looks like an assignment.
    who told you this is homework?I have done one of them,just making sure that the logic is right.Cannot run the program because I cannot run my turbo c++ compiler.

    Here is the selection sort:
    Code:
    void SelectionSort(int num[], int length)
    {
    int i, j, min, m,temp;
    
    for(i = 0; i<(length-1); i++)
    {
    m= i;
    
    min = num[i];
    
    for(j = i+1;j < length; j++) 
    {
    if(min > num[j]) 
    {
    m = j; 
    
    min = num[j];
    }
    }
     temp = num[i];
    
    num[i] = num[m]; 
    
    num[m]=temp; 
    }
    }

  5. #5
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    indent your code
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 12:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 12:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 09:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

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