answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

#include<string.h>

void sort(char [100][100], int);

void main()

{

char str[100][100];

int n, k;

clrscr();

printf("Enter number of words:");

scanf("%d",&n);

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

{

printf("Enter %d word ", k+1);

scanf("%s",str[k]);

}

sort(str, n);

getch();

}

void sort(char str[100][100], int n)

{

int i, j;

char temp[100];

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

{

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

{

if(strcmpi(str[i],str[j])>0)

{

strcpy(temp,str[i]);

strcpy(str[i],str[j]);

strcpy(str[j],temp);

}

}

}

printf("The sorted out data isn");

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

{

printf("%st", str[i]);

}

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


How do you write a c program to find the smallest word in a string?

what is if(!(str[i]==32))


What is Latin word for sorting?

diribitio and it translates to "sorting of the"


Write a PHP program to check whether the string is palindrome or not?

You can do this: &lt;?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }


What is the English translation of the German word lang?

lang = long


Can you give me a sentence using the word sorting?

Processing of data mostly includes sorting algorithms.


What is the definition of lang?

"Lang" as used in "Auld Lang Syne" is a word in the Scottish dialect meaning "long".


How you say grandma in java?

In Java, if you want to represent the word &quot;grandma,&quot; you can simply use a string variable. For example: String grandma = &quot;grandma&quot;; This will store the word &quot;grandma&quot; in the variable named grandma. You can then use this variable in your program as needed.


What does the root word of lang and ling mean?

The root word &quot;lang&quot; and &quot;ling&quot; both come from the Old English word &quot;lang&quot; which means &quot;long.&quot; In modern English, &quot;lang&quot; and &quot;ling&quot; are commonly used to refer to language or speech.


What phrase begins with the word string?

String him along is a saying. It begins with the word string.


What is a synonym for the word triage?

sort, sorting


Write a Java Program to find occurences of given word in a text?

Check the documentation of the String class, for a method that searches for a substring.