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

Differentiate between declaring a variable and defining a variable?

1091


What is the difference between text and binary i/o?

1113


What are the rules for identifiers in c?

1122


Explain high-order bytes.

1179


What is 1d array in c?

1156


Linked lists -- can you tell me how to check whether a linked list is circular?

1133


Explain what is the difference between text files and binary files?

1219


What are types of preprocessor in c?

1115


Write a program to print ASCII code for a given digit.

1128


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1258


Why is not a pointer null after calling free?

1074


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

1116


What is the difference between near, far and huge pointers?

1156


What is c basic?

1227


hi send me sample aptitude papers of cts?

2220