vinaysahuhbti
BAN USER# include<stdio.h>
# include<conio.h>
int max;
int count;
int index;
main()
{
int i,j;
char str[45];
printf("enter the string::\n");
gets(str);
i=0;
while(str[i]!='\0')
{
j=i+1;
if(str[j]==str[i])
{
while(str[j]==str[i])
{
max++;
j++;
}
}
if(count<max)
{
index=i;
count=max;
max=0;
}
i=j;
}
printf("longest string is::");
j=index;
while(str[j]==str[index])
{
putch(str[j]);
j++;
}
getch();
}
no bz. mst generates tree while we have to move on points in this question so it's not necessary that it is tree .....correct me if it is wrong
- vinaysahuhbti August 29, 2012