#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
void select(char *items, int count);
int main(void)
{
char s[255];
printf("Enter a string:");
gets(s);
select(s, strlen(s));
printf("The sorted string is: %s.\n", s);
getch();
return 0;
}
void select(char *items, int count)
{
register int a, b, c;
int exchange;
char t;
for(a = 0; a < count-1; ++a)
{
exchange = 0;
c = a;
t = items[ a ];
for(b = a + 1; b < count; ++b)
{
if(items[ b ] < t)
{
c = b;
t = items[ b ];
exchange = 1;
}
}
if(exchange)
{
items[ c ] = items[ a ];
items[ a ] = t;
}
}
}
design an algorithm for Selection Sort
No Answer is Posted For this Question
Be the First to Post Answer
what are the uses of C++
1. Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)
Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?.
what is pointers
different types of castings
function overridind means and simple program
I am developing a payroll system mini project.I used file concept in program for reading and writing.When the program is reloading into the memory that is if i execute next time the file was cleaned and adding data from the starting this is my problem.I want to strore the previous data and if i want to add any record that should be next of previous data.Please help me.
What are the two different types of polymorphism?
What is abstract class in oops?
what is ltti
create a c++ program that will accepts 9 inputs using 3 by 3 array.
Is this job good for future? can do this job post grduate student?