3. Program to print all possible substrings.
ex: String
S
St
Str
Stri
Strin
String
t
tr
tri
trin
tring
r
Answer Posted / rafiq
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
int i,j,n,k;
char a[10]="String";
i=0;
n=strlen(a);
for(i=0;i<n;i++)
{
for(j=i;j<n;j++)
{
for(k=i;k<j+1;k++)
{
printf("%c",a[k]);
}
printf("\n");
}
}
getch();
}
Is This Answer Correct ? | 51 Yes | 23 No |
Post New Answer View All Answers
Explain can static variables be declared in a header file?
What is header file in c?
Describe the modifier in c?
Tell me what are bitwise shift operators?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What is the g value paradox?
What is C language ?
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
What are all different types of pointers in c?
Can you define which header file to include at compile time?
Explain argument and its types.
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
program for reversing a selected line word by word when multiple lines are given without using strrev
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.