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
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...
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...
(8 marks) Write a program to ask user to input an integer and display the special...
Write a program to ask user to input an integer and display the special pattern accordingly. REQUIREMENTS The user input is always correct (input verification is not required). Your code must use loop statements (for, while or do-while). Your program should use only the following 3 output statements, one of EACH of the followings: System.out.print("-"); // print # System.out.print("+"); // print + System.out.println(); // print a newline Your code must work exactly like the following example (the text in bold...
Write a c++ program that prints all possible distinct “words” that can be obtained by permuting...
Write a c++ program that prints all possible distinct “words” that can be obtained by permuting the letters of the word input by users. (Note: A “word” here refers to a sequence of letters and need not be in the dictionary.) For example: Input word to find permutations: abc acb bac bca cba cab
create a program in c++ to determine whether any 5-letter word is a palindrome. Palindromes are...
create a program in c++ to determine whether any 5-letter word is a palindrome. Palindromes are words or sentences that read the same backward or forward. For example, “kayak” is a palindrome while “meter” is not. Ask the user to input 5 characters. You will need five separate variables to store these five characters. After obtaining the characters, compare the characters to determine if the word is a palindrome and output an appropriate message. Ex: Please enter 5 letters: h...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT