C Programming Language
2nd Edition
ISBN: 9780131103627
Author: Brian W. Kernighan, Dennis M. Ritchie, Dennis Ritchie
Publisher: Prentice Hall
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 1, Problem 9E
Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Create a program that takes in a sentence from user input, the program then removes the last word and first word in the sentence. The remaining string is converted to upper case then printed out. [Hint: In case there is only two words, an empty line is printed]
Sample run 1: Sample run 2:
Enter a sentence: Hello There Enter a sentence: Happy Thursday Everyone
Output: Output: THURSDAY
Asap.
Use Python language.
Write a program to input the length of a string x and then
generate a random string having a length equal to x. The
string should contain only lowercase alphabets. Display
the random string in the output.
Chapter 1 Solutions
C Programming Language
Ch. 1 - Run the hello, world program on your system....Ch. 1 - Prob. 2ECh. 1 - Modify the temperature conversion program to print...Ch. 1 - Write a program to print the corresponding Celsius...Ch. 1 - Prob. 5ECh. 1 - Prob. 6ECh. 1 - Write a program to print the value of EOF.Ch. 1 - Write a program to count blanks, tabs and...Ch. 1 - Write a program to copy its input to its output,...Ch. 1 - Write a program to copy its input to its output,...
Ch. 1 - Prob. 11ECh. 1 - Write a program that prints its input one word per...Ch. 1 - Write a program to print a histogram of the...Ch. 1 - Write a program to print a histogram of the...Ch. 1 - Rewrite the temperature conversion program of...Ch. 1 - Revise the main routine of the longest-line...Ch. 1 - Write a program to print all input lines that are...Ch. 1 - Write a program to remove trailing blanks and tabs...Ch. 1 - Write a function reverse(s) that reverses the...Ch. 1 - Write a program detab that replaces tabs in the...Ch. 1 - Write a program entab that replaces strings of...Ch. 1 - Write a program to fold long input lines into two...Ch. 1 - Prob. 23ECh. 1 - Write a program to check a C program for...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
In this chapter, we use the metaphor of a cookie cutter and cookies that are made from the cookie cutter to des...
Starting Out with Python (4th Edition)
When a GroupBox control is deleted, what happens to the controls that are inside?
Starting Out With Visual Basic (8th Edition)
Describe and implement state descriptions, move generators, terminal tests, utility functions, and evaluation f...
Artificial Intelligence: A Modern Approach
Assume the following declaration exists : enum Coffee { MEDIUM, DARK, DECAF } Find the error(s) in the followin...
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Explain the benefits of marking transaction boundaries, declaring lock characteristics, and letting a DBMS plac...
Database Concepts (7th Edition)
A file that contains a Flash animation uses the __________ file extension. a. .class b. .swf c. .mp3 d. .flash
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 2. In Python programming language, write a program to input a string and then add the string "programming" to that string and print the result in the output. If the input string is equal to "programming" then print the original string in the output.arrow_forwardTask 2 Write a Python program that will ask the user to enter a word as an input. • If the length of the input string is less than 4, then your program should print the same string as an output. • If the input string's length is greater than 3, then your program should add "er" at the end of the input string. • If the input string already ends with "er", then add "est" instead. • If the input string already ends with "est", then your program should print the same input string as an output. Example 1: Input: strong Output: stronger Example 2: Input: stronger Output: strongest Example 3: Input: strongest Output: strongestarrow_forwardCreate a program that uses INITIALS M and P to create a pattern using nested loops. The pattern is up to you; however, your initial needs to appear at least eight times in the pattern.arrow_forward
- Use do-while loop in C languagearrow_forwardGiven a sequence of N input number variables, where itself is an input variable number, write predocode for a program that first checksif N is greater than zero and then goes on to output the minimum of the N input numberarrow_forwardWrite a Python program that will ask the user to input a word, will return the first letter of the input word, and ask the user to put another word, and so on, in the form of a loop. If the user chooses to stop, he or she should input the integer "0" for the loop to stop.arrow_forward
- Design a python program that asks the user to enter a string. The string will then be displayed back to the user. This is followed by determining the number of alphabetic characters, numeric characters, lowercase letters, uppercase letters, whitespace characters and then displaying them. The user should be given additional chances to enter additional strings, and each time a string is entered, the above process is to be performed. The inputting is to stop, when the user enters "end" as the input string. At that point, total number of alphabetic characters, numeric characters, lowercase letters, uppercase letters, whitespace characters are to be displayed and the program terminated. An algorithm: 1. Prompt the user to enter a string at the keyboard 2. As long as the string is not "end" 2.1 Display the string, along with an appropriate message 2.2 Examine the current character of the string 2.2.1 If it's alphabetic, update the alphabetic_counter and the…arrow_forwardTask 12 Write a python program that takes 2 inputs from the user. The first input is a string and the second input is a letter. The program should remove all occurences of the letter from the given string and print the output. If the letter is not found in the string and the length of string is greater than 3, then remove the first letter and last letter of the given string and print it. Otherwise print the string as it is. [You can assume that all the input will be in lowercase letter] Sample Input 1: tanjiro kamado a Sample output 1: tnjiro kmdo Explanation: All 3 instances of the character 'a' is removed from the input String 'tanjiro kamado' to give us output 'tnjiro kmdo'. ======== ========arrow_forwardWrite a program that prompts the user to provide a single character from the alphabet. Print Vowel or Consonant, depending on the user input. If the user input is not a letter (between a and z or A and Z), or is a string of length > 1, print an error message. Sample Run Sample Run Sample Run Sample Run Enter one character: python Enter one character: B Enter one character: e Consonant Enter one character: & That was neither a vowel nor a consonant. That input didn't have a valid length. Vowelarrow_forward
- Python program Write a program to take user input for 2 strings and then concate it and print the results.arrow_forwardWrite a program Frequency that reads strings from standard input and printsthe number of times each string occurs, in descending order of frequency.arrow_forwardWrite a program that reads from the user a character ('s' or 'a'). If the character is 's', the program reads 4 numbers from keyboard and then finds their sum. If the character is 'a the program reads 4 numbers from keyboard and then finds their average. Ötherwise, it prints "Wrong character Sample Run: Sample Runl: Enter a character (s or a) : s Input 4 numbers: 10.5 12 31 44 The sum of these 4 numbers is: 97.5 Sample Run2: Enter a character (s or a): a Input 4 numbers: 10 12 31 44 The average of these 4 numbers is: 24.375 Sample Run3: Enter a character (s or a): d Wrong characterarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY