#include<stdio.h> #include<conio.h> int main() { char str[100],temp; int i,j; clrscr(); printf("Enter the string :"); gets(str); printf("%s in ascending order is -> ",str); for(i=0;str[i];i++) { for(j=i+1;str[j];j++) { if(str[j]<str[i]) { temp=str[j]; str[j]=str[i]; str[i]=temp; } } } printf("%s\n",str); getch(); return 0; } Output: Enter the string : syntax syntax in ascending order is -> anstxy
Sequential search is the only way to search an unsorted array unless you resort to a multi-threaded parallel search where all threads concurrently search a portion of the array sequentially.
How to write a program for mouse in microprocessor?
Reference:cprogramming-bd.com/c_page1.aspx# array programming
To write a C++ program to display the student details using class and array of object.
int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }
Sequential search is the only way to search an unsorted array unless you resort to a multi-threaded parallel search where all threads concurrently search a portion of the array sequentially.
One efficient way to find the median of an unsorted array of numbers is to first sort the array in either ascending or descending order, then determine the middle value as the median.
The best search algorithm to use for an unsorted array is linear search. It involves checking each element in the array one by one until the desired element is found. This algorithm has a time complexity of O(n), where n is the number of elements in the array.
The median of an unsorted array of numbers is the middle value when the numbers are arranged in numerical order. It divides the array into two equal parts, with half of the numbers being greater than the median and half being less than the median.
How to write a program for mouse in microprocessor?
Reference:cprogramming-bd.com/c_page1.aspx# array programming
To write a C++ program to display the student details using class and array of object.
To find the kth smallest number in an unsorted array, you can use a sorting algorithm like quicksort or heapsort to arrange the array in ascending order. Then, you can simply access the kth element in the sorted array to find the kth smallest number. This process ensures that the kth smallest number is easily identified and retrieved from the array.
write an assembly language program to find sum of N numbers
array type
int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }
n-1 times