3. Program to print all possible substrings.
ex: String
S
St
Str
Stri
Strin
String
t
tr
tri
trin
tring
r
Answer Posted / nik
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main(){
int i,j=0,k=0,n;
char str[50],str1[25],str2[25],temp;
puts("Enter String");
gets(str);
n=strlen(str);
for(i=0;i<n;i++){
for(j=i;j<n;j++){
for(k=j;k<n;k++){
printf("%c",str[k]);
}
printf("\n");
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 15 Yes | 21 No |
Post New Answer View All Answers
What are the different types of C instructions?
Who is the main contributor in designing the c language after dennis ritchie?
Explain the use of 'auto' keyword
Why main function is special give two reasons?
What is graph in c?
What is structure pointer in c?
Explain what are run-time errors?
In C language what is a 'dangling pointer'?
Is it possible to pass an entire structure to functions?
What is the difference between strcpy() and memcpy() function in c programming?
What is the mean of function?
What is structure in c language?
What is a spanning Tree?
What is an array? What the different types of arrays in c?
Do you know the difference between exit() and _exit() function in c?