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
Write a program to know whether the input number is an armstrong number.
What is the purpose of sprintf() function?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
what is the different bitween abap and abap-hr?
Why is c faster?
Why c is called procedure oriented language?
how can I convert a string to a number?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
How is a macro different from a function?
explain what is a newline escape sequence?
Write a program to check armstrong number in c?
What is structure data type in c?
Can you assign a different address to an array tag?
Explain Basic concepts of C language?
What is adt in c programming?