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 / 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


Please Help Members By Posting Answers For Below Questions

can anyone suggest some site name..where i can get some good data structure puzzles???

2096


How will you divide two numbers in a MACRO?

1152


Why can arithmetic operations not be performed on void pointers?

1063


what is a constant pointer in C

1195


Explain how do you search data in a data file using random access method?

1141


In a byte, what is the maximum decimal number that you can accommodate?

1156


What are the advantage of c language?

1065


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3706


What are external variables in c?

1114


What are pointers?

1128


List the difference between a "copy constructor" and a "assignment operator"?

1026


Why does everyone say not to use scanf? What should I use instead?

1433


How is a null pointer different from a dangling pointer?

1045


What is #line?

1071


What is operator promotion?

1087