Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is difference between structure and union in c programming?

1174


In c programming language, how many parameters can be passed to a function ?

1167


What are volatile variables in c?

994


What is c preprocessor mean?

1373


Can a variable be both constant and volatile?

1180


What does 3 periods mean in texting?

1132


What is function in c with example?

1229


Explain how are portions of a program disabled in demo versions?

1173


Explain how do you sort filenames in a directory?

1076


Explain how are 16- and 32-bit numbers stored?

1306


What is the difference between functions getch() and getche()?

1137


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1644


What do you understand by normalization of pointers?

1101


What does struct node * mean?

1067


What does void main () mean?

1297