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
Describe wild pointers in c?
Can you add pointers together? Why would you?
What are different storage class specifiers in c?
what is the height of tree if leaf node is at level 3. please explain
Can we access array using pointer in c language?
What is data structure in c programming?
Write a code to generate divisors of an integer?
What are the different data types in C?
Are negative numbers true in c?
Is c is a low level language?
Who developed c language?
If fflush wont work, what can I use to flush input?
Explain what is the stack?
What is pointer to pointer in c?
Why static is used in c?