write program in C that print the continuous sub strings of a given string so if the user enter "ABC" the output should be "A, B, C, AB, BC"
#include<stdio.h>
int main()
{
char s[100];
//reading input
printf("Enter string:");
scanf("%s",&s);
int n;
for(n=0;s[n]!='\0';n++);//finding length of string
entered
//displaying ouput
for(int i=1;i<n;i++)
{
for(int
j=0;j<(n-(i-1));j++)
{
int k =j;
for(int
c=0;c<i;c++,k++)
{
printf("%c",s[k]);
}
printf("\n");
}
}
return 0;
}
output:
Enter string:ABC
A
B
C
AB
BC
Process exited normally.
Press any key to continue . . .
//PLS give a thumbs up if you find this helpful, it helps me alot,
thanks.
write program in C that print the continuous sub strings of a given string so if...
Write a program that uses String method regionMatches to compare two strings input by the user. The program should prompt the user to enter two strings, the starting index in the first string, the starting index in the second string, and the number of characters to be compared. The program should print whether or not the strings are equal, (Ignore the case of the characters during comparison.) 四SAMPLE RUN #1: java StringCompare Highlight: None D Show Highlighted Only Interactive Session...
C++ Write A Program: //Please DONT use stdio.h or fancy things like classes Given the following header: vector<string> split(string target, string delimiter); implement the function split so that it returns a vector of the strings in target that are separated by the string delimiter. For example: split("10,20,30", ",") should return a vector with the strings "10", "20", and "30". Similarly, split("do re mi fa so la ti do", " ") should return a vector with the strings "do", "re", "mi",...
Exercise #4: Some Operations on Strings Write a program that uses a C-string to store a string entered from the keyboard (in lower case letters). The program will then provide 6 options about operations performed on the input string in the form of a menu, as shown in the following sample Input/Output. The 6 operations are given below: 1. print the string 2 reverse the string 3. print the length of the string 4. convert the lower letters to upper...
and then print their average. Write a C program that accepts a string of text from the user and prints back the string without any of the vowels. For example, if the user entered "Hello, world", the program should print "Hll, wrld" Write a C program that accepts an integer in decimal from the user and prints the number of 1' bits in the integers binary representation. For example, if the user entered 14, the program should print 3 because...
IN JAVA (Maximum consecutive increasingly ordered sub-string) Write a program that prompts the user to enter a string and displays the maximum consecutive increasingly ordered sub-string. Analyze the time complexity of your program and explain. Here is a sample run: Enter a string: abcabcdgabxy output abcdg Time complexity is O( ). -n must be display between the parenthesis.
b) Write a program that takes three strings from the user, compare the strings, and output them concatenated (as one string). The concatenated string should contain the three strings from shorter to longer.
Objectives: Use strings and string library functions. Write a program that asks the user to enter a string and output the string in all uppercase letters. The program should then display the number of white space characters in the string. You program should run continuously until the user enters an empty string. The program must use the following two functions: A function called count_spaces that counts the number of white spaces inside a string. int count_space(char str[]); which tell you...
Write a C program to “de-vowel” an input string. Assume that the user provides input containing only the characters a through z (i.e., all lowercase letters). Your program should create an output string that deletes all vowels from the input string, pushing the letters together to fill any gaps. For example, given the input “theturtleandthehare” your code should print out “thtrtlndthhr”. Your program should create an output string from the input string, before printing its output. Sample Input: Enter a...
Assembly program: NASM assembler write a program to print the location of character "i" from a input string from left to right. User inputs a strings upto 40 characters.
Three C Code Questions: 5. Write a C program that declares an array of 10 strings, each of max length 50 characters, and then reads an entire line of text from the keyboard into each string. 6. Write C code that finds the longest name in this array of strings that you read in Q5. Hint: find the position of the longest string, not the string itself. 7. Write a C program that creates a 4 x 6 two dimensional...