#include
#include
#include
#include
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
2607
Write a program to implement OOPS concepts such as
inheritance, polymorphism, friend function, operator
overloading?
4807
What is difference between abstraction and encapsulation?
1137
Which is not an object oriented programming language?
1047
Why is polymorphism used?
1093
Can bst contain duplicates?
1250
What is class and object in oops?
1218
Can static class have constructor?
1087
why reinterpret cast is considered dangerous?
2455
Can we create object of abstract class?
1154
What is encapsulation in oop?
1106
What is multilevel inheritance in oop?
1091
What are the important components of cohesion?
1080
can we make game by using c
4229
What is the purpose of enum?
1061