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
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What is build process in c?
Is anything faster than c?
Is return a keyword in c?
Why is sprintf unsafe?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
What are 3 types of structures?
Explain how can you tell whether two strings are the same?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What is integer constants?
What is the difference between array and structure in c?
What is masking?
Why c language is called c?
What type is sizeof?
explain what are pointers?