1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vera_Pavlovna [14]
3 years ago
7

Write a program named as reverse.c that reads a message, then prints the reversal of the message. The output of the program shou

ld look like t
Computers and Technology
1 answer:
AfilCa [17]3 years ago
7 0

Answer:

Written in C:

#include <stdio.h>

#include <strings.h>

int main(){

   char userinput[100];

   printf("Enter a message: ");

   scanf("%s",&userinput);

   int lent = strlen(userinput);

   for (int i=lent-1; i>=0; i--)

     printf("%c",userinput[i]);

   return 0;    

}

Explanation:

This line declares a string variable

   char userinput[100];

This line prompts user for input

   printf("Enter a message: ");

This line gets user input

   scanf("%s",&userinput);

This line calculates the length of user input

   int lent = strlen(userinput);

This iterates through the characters of user input

   for (int i=lent-1; i>=0; i--)

This prints the characters in reverse

     printf("%c",userinput[i]);

You might be interested in
Name three situations when a copy constructor executes.
Vesna [10]

Answer:

1. When an object of the class is passed (to a function) by value as an argument.

2.  When an object is constructed based on another object of the same class.

3. When compiler generates a temporary object.

Explanation:

7 0
3 years ago
Maxwell says three things Level Two Leaders do well are:
IRINA_888 [86]

Answer:

true

Explanation:

3 0
4 years ago
What are the binary symbols?
alexgriva [62]

Answer:

Explanation:

a binary number is a number expressed in the base-2 numeral system or binary numeral system

4 0
3 years ago
Read 2 more answers
An incident response plan should be created be for a software system is released for use.
Nat2105 [25]
The answer is choice “a. True”.
8 0
2 years ago
Problem 1. MST - Prim's and Kruskal's algorithms
Juli2301 [7.4K]
Or maybe not Encryption converts the data in a database to a format that is indecipherable to unauthorized users who attempt to bypass the DBMS.

a. True
b. False
7 0
3 years ago
Other questions:
  • Crossing out answers that could not possibly be correct is called ‘eliminating answers.’ Please select the best answer from the
    13·2 answers
  • What is variable declaration in java ​
    6·2 answers
  • A document created by the scriptwriter that contains general information about a program is called _____.
    15·1 answer
  • Explain the role of a computer in education​
    9·1 answer
  • A(n) __________ prevents outsiders from accessing corporate information the user does not want others to see.
    9·1 answer
  • Can someone tell me how to fix the keyboard on ipad?- its in the middle of my screen andd i dont know how to do it
    13·1 answer
  • What is the benefit of hosting a website on a personali
    6·1 answer
  • The purpose of an Internet _____ is to receive packets and send them along towards their final destination.
    8·1 answer
  • What Does The Computer Monitor Contain?
    8·1 answer
  • Would it be feasible to combine fixed length field and variable length field format in single disk
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!