3. Program to print all possible substrings.
ex: String
S
St
Str
Stri
Strin
String
t
tr
tri
trin
tring
r
Answer Posted / rafiq
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
int i,j,n,k;
char a[10]="String";
i=0;
n=strlen(a);
for(i=0;i<n;i++)
{
for(j=i;j<n;j++)
{
for(k=i;k<j+1;k++)
{
printf("%c",a[k]);
}
printf("\n");
}
}
getch();
}
| Is This Answer Correct ? | 51 Yes | 23 No |
Post New Answer View All Answers
What is difference between structure and union in c programming?
In c programming language, how many parameters can be passed to a function ?
What are volatile variables in c?
What is c preprocessor mean?
Can a variable be both constant and volatile?
What does 3 periods mean in texting?
What is function in c with example?
Explain how are portions of a program disabled in demo versions?
Explain how do you sort filenames in a directory?
Explain how are 16- and 32-bit numbers stored?
What is the difference between functions getch() and getche()?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
What do you understand by normalization of pointers?
What does struct node * mean?
What does void main () mean?