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

Write a program to know whether the input number is an armstrong number.

1085


What is the purpose of sprintf() function?

1073


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

1030


what is the different bitween abap and abap-hr?

2249


Why is c faster?

1034


Why c is called procedure oriented language?

1009


how can I convert a string to a number?

1045


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

1014


How is a macro different from a function?

1134


explain what is a newline escape sequence?

1049


Write a program to check armstrong number in c?

1102


What is structure data type in c?

989


Can you assign a different address to an array tag?

1126


Explain Basic concepts of C language?

1097


What is adt in c programming?

1122