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


Please Help Members By Posting Answers For Below Questions

Describe wild pointers in c?

644


Can you add pointers together? Why would you?

651


What are different storage class specifiers in c?

623


what is the height of tree if leaf node is at level 3. please explain

1604


Can we access array using pointer in c language?

650






What is data structure in c programming?

576


Write a code to generate divisors of an integer?

645


What are the different data types in C?

731


Are negative numbers true in c?

604


Is c is a low level language?

568


Who developed c language?

644


If fflush wont work, what can I use to flush input?

620


Explain what is the stack?

638


What is pointer to pointer in c?

636


Why static is used in c?

627