Professional Documents
Culture Documents
Extra Programs
for(i=0;i<no-1;i++)
for(j=i+1;j<no;j++)
int main()
{
{ if(strcmp(string[i],string[j])>0)
{
char string[30][30],temp[30];
strcpy(temp,string[i]);
int no, i, j;
cout<<"\nEnter the no of strings:"; strcpy(string[i],string[j]);
strcpy(string[j],temp);
cin>>no; }
cout<<"\nEnter the strings:"; }
D E L H I \0
A G R A \0
B A R E L I \0
A G R A \0
B A R E L I \0
D E L H I \0
#include<stdlib.h>
gets(substr1);
int main()
for(i=0;str[i]!='\0';i++)
{ char str[50], substr1[50];
{
int i,pos,k,len,j;
j=0;
cout<<"enter the main string "<<endl;
if(str[i]==substr1[j])
gets(str); {
pos=i;
j++;