dear Athiyamaan,
Try the following code..
this will help u..
#include<stdio.h>
#include<string.h>
main()
{
char names[10][10],temp[10];
int i,j,n;
clrscr();
printf("enter howmany names?");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s",names[i]);
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if ( (strcmp(names[i],names[j])) >0 )
{
strcpy(temp,names[i]);
strcpy(names[i],names[j]);
strcpy(names[j],temp);
}
}
}
for(i=0;i<n;i++)
printf("\n%s",names[i]);
}
athiya maan <[EMAIL PROTECTED]> wrote:
#include<string.h>
main()
{
char names[10][10],temp[10];
int i,j,n;
clrscr();
printf("enter howmany names?");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%s",names[i]);
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if ( (strcmp(names[i],names[j])) >0 )
{
strcpy(temp,names[i]);
strcpy(names[i],names[j]);
strcpy(names[j],temp);
}
}
}
for(i=0;i<n;i++)
printf("\n%s",names[i]);
}
athiya maan <[EMAIL PROTECTED]> wrote:
Hai Friends,>>I am new to this Group.>>Help me on the Following program:Arrange 10 Strings in alphabet order.Please Help me with this Program...
With Wishes
B.Athiyamaan. B.Tech(IT),Arunai Engg. College,Thiruvannamalai.
Heres a new way to find what you're looking for - Yahoo! Answers
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail Beta. __._,_.___
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
![]()
SPONSORED LINKS
C programming language Programming languages Computer programming languages Java programming language
YAHOO! GROUPS LINKS
- Visit your group "c-prog" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
- Re: [c-prog] Hai veerubhotla sharma
- [c-prog] hai Praveen Kumar
- Re: [c-prog] hai Brett W. McCoy
- Re: [c-prog] hai Praveen Kumar
- Re: [c-prog] hai Brett W. McCoy
Reply via email to
