Question

***C Programming, Create program that can ask users to input a wird of text. Then convert...

***C Programming, Create program that can ask users to input a wird of text. Then convert the user's text to uppercase. Users may lowercase or uppercase letters. use Strings to comoute these tasks... 'x'+1='y'

Homework Answers

Answer #1

Assumptions:
1. The user inputs from command line
2. The output shown in command line

#include <stdio.h>
#include <string.h>
int main() {
char txt[100];
int i;
//Enter the Text
printf("\nEnter a string : ");
//Reading String
fgets(txt, sizeof(txt), stdin);
//Looping String
while (txt[i]) {
//converting alphabets to Uppercase
if(txt[i] >= 'a' && txt[i] <= 'z') {
txt[i] = txt[i] - 32;
}
i++;
}
//Prints the output
printf("\nString in Upper Case: ");
puts(txt);
return 0;
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Programming Challenge B write a simple program that takes as input 2 16-bit strings of 0's...
Programming Challenge B write a simple program that takes as input 2 16-bit strings of 0's and 1's. (For example one string is assigned X and on string is assigned Y). Compute and and display the bitwise AND, bitwise OR, and bitwise XOR of the two string, (For example, the resultant string is Z). You may use the programming language of your choice. Alternatively, if you do not know a programming language, you may describe your algorithm in plain text...
c# please Create a “Main” program which reads a text file called “collectionOfWords.txt”. Include exception handling...
c# please Create a “Main” program which reads a text file called “collectionOfWords.txt”. Include exception handling to check if the file exists before attempting to open it. Read and print each string to the console. Next modify each word such at the first letter in each word is uppercase and all other letters are lowercase. Display the modified word on the console. Creating a text file: Open up Notepad and type in the following words. Save the file as collectionOfWords.txt...
Write a Python program to ask how many elements do users want to create in a...
Write a Python program to ask how many elements do users want to create in a list, then let the user create 2 lists with the number of elements previously entered. Then create and display all combinations of letters, selecting each letter from a different key in a dictionary. Example: How many elements? 2 List 1 = ['a', 'b'] List 2 = ['c', 'd'] Output: ac ad bc bd
I need python code for this. Write a program that inputs a text file. The program...
I need python code for this. Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase words should take precedence over lowercase words. For example, 'Z' comes before 'a'. The input file can contain one or more sentences, or be a multiline list of words. An example input file is shown below: example.txt the quick brown fox jumps over the lazy dog An example of the program's output...
use php only User can input ant value in text format Users have no restriction on...
use php only User can input ant value in text format Users have no restriction on the number of order items they can. The program outputs the data type: String Integer Boolean Decimal NULL Requirements 1. You may not use an array 2. You may not use any 'is_' functions for checking null, bool, integer, decimal or string types. 3. You may not use regular expressions. 4. If the user enters 'null' the value should be null. 5. If the...
Write a Python program to ask user input of a string, then ask user input of...
Write a Python program to ask user input of a string, then ask user input of what letters they want to remove from the string. User can either put in "odd", "even" or a number "n" that is greater than 2. When user input "odd", it will remove the characters which have odd numbers in the sequence of the string. When user input "even", it will remove the characters which have even numbers in the sequence of the string. When...
Write a python program that will perform text analysis on an input text using all of...
Write a python program that will perform text analysis on an input text using all of the following steps: 1. Take the name of an input file as a command line argument. For example, your program might be called using python3 freq.py example1 to direct you to process a plain text file called example. More information is given on how to do this below. 2. Read the contents of the file into your program and divide the text into a...
Programming can be used to assist users in completing complex calculations very quickly. As seen in...
Programming can be used to assist users in completing complex calculations very quickly. As seen in class practices, we were able to calculate the area of geometric shapes, figure out the number of calories in cookies, and even calculate a restaurant bill. For this assignment, you will take input from the user to provide interactive messages and to solve the following word problem: Engineers often need to convert between different types of units to perform calculations that follow standard formulas....
(C PROGRAMMING) Please use arrays// Create a program that presents a menu to the user to:...
(C PROGRAMMING) Please use arrays// Create a program that presents a menu to the user to: 1) enter data 2) print data 3) clear data 0) exit. Please complete option 3.
1 Design and implement FileCompare program that compares two text input files (file1.txt and file2.txt), line-by-line,...
1 Design and implement FileCompare program that compares two text input files (file1.txt and file2.txt), line-by-line, for equality. Print any lines that are not equivalent indicating the line numbers in both files. The language of implementation is java 2 . Create a program that reads a string input from the user, then determines and prints how many of each lowercase vowels (a, e. i, o, and u) appear in the entire string. Have a separate counter for each vowel. Also...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT