#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,m,a[20],b[20],c[20],max;
printf("enter no of elements");
scanf("%d",&m);
printf("enter elements");
for(i=0;i<=m;i++)
{
scanf("%d",&a[i]);
}
max=a[i];
for(i=0;i<=m;i++)
{
if(max<a[i])
{
max=a[i];
}
}
for(i=0;i<=max;i++)
{
c[i]=0;
}
for(j=0;j<=m;j++)
{
c[a[j]]=c[a[j]]+1;
}
for(i=0;i<=max;i++)
{
c[i]=c[i]+c[i-1];
}
for(j=m;j>=1;j--)
{
b[c[a[j]]]=a[j];
c[a[j]]=c[a[j]]-1;
}
printf("AFTER SORTING");
for(i=0;i<=m;i++)
{
printf("%d",b[i]);
}
getch();
}
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.
for(i = 0; i < num_students; i ++){ sort(student[i]); } That's what you get when you're that specific!
The standard library sort algorithm automatically uses MSD radix to sort strings: std::vector<std::string> vs = {"a", "b", "c" "d", "ab"}; std::sort(vs.begin(), vs.end()); After sorting, the order will be: {"a", "ab", "b", "c", "d"}
If you are using an array : sort using qsort() then take middle element.
123
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
Writing a C program that uses dynamic memory allocation to sort names in ascending order is a typical computer science assignment. To write this program, you must be in UNIX.
for(i = 0; i < num_students; i ++){ sort(student[i]); } That's what you get when you're that specific!
The standard library sort algorithm automatically uses MSD radix to sort strings: std::vector<std::string> vs = {"a", "b", "c" "d", "ab"}; std::sort(vs.begin(), vs.end()); After sorting, the order will be: {"a", "ab", "b", "c", "d"}
If you are using an array : sort using qsort() then take middle element.
plz as soon as possible give me the program for shorting an array in asscending order without using any sort function in c++
It depends on the particular IDE. Visual Studio uses <Ctrl>F5 to start a program in non-debug mode, and F5 to start a program in debug mode.
A stack is implicitly sorted by hierarchical nested order. It does not make sense to sort a stack. Do you mean a list? If so, please ask the question again.
first sort the ten numbers in descending order and print the first number. That will be the largest no
c program was introduced in the year 1972 by Dennis RitchieNo, it was the C language, not the C program.
Every C program must have a function, named main(), which is where the program starts execution. If there is no function main(), the computer does not know where to start running the program. The function main() must also do something; if it is just empty, some smarter compilers will note that there is nothing for the program to do, and will give this sort of error message to indicate that you forgot to tell the program what to do.