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
Differentiate between declaring a variable and defining a variable?
What is the difference between text and binary i/o?
What are the rules for identifiers in c?
Explain high-order bytes.
What is 1d array in c?
Linked lists -- can you tell me how to check whether a linked list is circular?
Explain what is the difference between text files and binary files?
What are types of preprocessor in c?
Write a program to print ASCII code for a given digit.
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
Why is not a pointer null after calling free?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What is the difference between near, far and huge pointers?
What is c basic?
hi send me sample aptitude papers of cts?