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 is ur strangth & weekness
What is the difference between break and continue?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
which type of aspect you want from the student.
What is the ANSI C Standard?
Is it possible to execute code even after the program exits the main() function?
Can we declare a function inside a function in c?
What is the general form of a C program?
Difference between goto, long jmp() and setjmp()?
Can we declare variables anywhere in c?
What is methods in c?
Explain what standard functions are available to manipulate strings?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
What is structure padding in c?
What is identifiers in c with examples?