Question: Q 3 Write a C program that: Asks the user to enter two words. Prints the letters of the string backwards. The letters should be
Q Write a C program that:
Asks the user to enter two words.
Prints the letters of the string backwards.
The letters should be printed on the same line, not one per line.
The program produces output as shown below:
Please enter the first word: Blue
Please enter the second word: Dart
First word reversed: eulB traD
Q Write a C program that does the following:
Defines an integer array arr ;
Lists all pairs of numbers of consecutive numbers as shown in the sample output.
Uses for loops to solve the problem.
Q Write a C program that does the following:
Accepts a to digit number or from the user in an infinite loop.
The program comes out of the infinite loop and exits if the user types
Sums the digits of the number.
Defines a function int sumdigits int num that accepts an integer and returns the sum of its digits.
Prints the sum of the digits.
Prints an output as shown below.
Please enter a number to digits or to exit:
The sum of digits of is
Please enter a number to digits or to exit:
The sum of digits of is
Please enter a number to digits or to exit:
Exiting the program.
Q Write a C program that does the following:
Accepts a to character word or "exit" from the user in an infinite loop.
The program comes out of the infinite loop and exits if the user types "exit".
Uses bubble sort to sort the characters in the user input.
Prints the sorted word.
Prints an output as shown below.
Please enter a word to characters or 'exit' to quit: words
Sorted word: dorsw
Please enter a word to characters or 'exit' to quit: characters
Sorted word: aaccehrrst
Please enter a word to characters or 'exit' to quit: yellow
Sorted word: ellowy
Please enter a word to characters or 'exit' to quit: exit
Exiting the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
