answersLogoWhite

0

#include<stdio.h>

#include<string.h>

void main()

{

char name[10][10],temp[10];

int i,j,n,k;

printf("Enter number of names for inputing ::");

scanf("%d",&n);

for(i=0;i<n;i++)

{

printf("Enter Names ::");

scanf("%s",name[i]);

}

for(i=0;i<n-i;i++)

{

for(j=0;j<n-i-1;j++)

{

k=strcmp(name[j],name[j+1]);

if(k>0)

{

strcpy(temp,name[j]);

strcpy(name[j],name[j+1]);

strcpy(name[j+1],temp);

}

}

}

for(i=0;i<n;i++)

{

printf("\n%s",name[i]);

}

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Difference between internal and external sorting?

Internal sorting it means we are arranging the number within the array only which is in computer primary memory. External sorting it is the sorting of numbers from the external file by reading it from secondary memory.


Given two arrays A and B Array?

distinguish extra element in two arrays


What are the advantages of insertion sort?

It is less efficient on list containing more number of elements. As the number of elements increases the performance of the program would be slow. Insertion sort needs a large number of element shifts.


Bubble sort Extra or in space?

Bubble sort is an "in place" algorithm. Other than a temporary "switch" variable, no extra space is required.


What is extra output generated by one more unit of variable input?

Marginal Product


What is the variable for a pile of leaves plus six extra?

Heaped cone as varied from half to level..


What is complex sort?

Time complexity Best case: The best case complexity of bubble sort is O(n). When sorting is not required, all the elements are already sorted. Average case: The average case complexity of bubble sort is O(n*n). It occurs when the elements are jumbled, neither properly ascending nor descending. Worst case: The worst-case complexity of bubble sort is O(n*n). It occurs when the array elements are needed to be sorted in reverse order. Space complexity In the bubble sort algorithm, space complexity is O(1) as an extra variable is needed for swapping.


What is mean by Extra key inserted at the end of Array?

It means the array has a sentinel to mark the end of the array. Any elements that follow the sentinel element are deemed invalid. Sentinels are usually denoted with a special value that is not used by any of the elements that precede it. Null-terminated strings are an example, where the NULL character (ASCII code 0) marks the end of a character array.


Can an undernourished person perform extra work without extra food?

yes


Can you get a iPhone without internet without the extra 30 dollars?

unblocked it


Can you take guinea pigs on the Disney cruise without extra cost?

No. It will cost you extra.


Manaphy without extra DS?

not possible