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
What are the three main purposes of an operating system? Explain how the old mainframe computers were different from the compute
lbvjy [14]

Answer:(1) To manage the computer's resources, which includes central processing unit, memory, disk drives, and printers, (2) To establish a user interface

(3)To execute and provide services for applications software.

The old mainframe computers have

(1) low memory sizes

(2) slower connectivity speed

(3) Larger sizer

(4) low sophistication.

Explanation: Operating system is a system software that manages the computer resources,helps to establish user interface and it helps to provide services for application softwares.

Operating system software includes WINDOWS X,WINDOWS 7,WINDOWS 8,LINUX,etc.

Mainframe computers are computers used by large multinational companies for processing bulk data. Old mainframe computers were produced by IBM(INTERNATIONAL BUSINESS MACHINE) in the year 1952 they are classed two scientific and commercial mainframe computers with different information although they had some incompatibilities. Old mainframe computers are large in size with low processing speed, sophistication and storage compared to present day system.

3 0
3 years ago
Each row in a database is a set of unique information called a(n)
blondinia [14]

A row, which is also called a tuple.

4 0
3 years ago
Read 2 more answers
Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
aleksandrvk [35]
I guess the answer True
3 0
3 years ago
Pseudo code for rolling a dice
iogann1982 [59]

Answer:

Explanation:

In this exercise, you will roll a pair of dice until the numbers add up to a given number. You can assume that the given number is 2, 3, 6, or 12. Using pseudocode, write an algorithm that returns the number of times the dice is rolled to achieve this number.

3 0
3 years ago
In c++
Elodia [21]

Answer:

class studentType: public personType

{

public:

virtual void print() = 0;

virtual void calculateGPA() = 0;

void setID(long id) {

studentId = id;

}

void setCourses(const string c[], int noOfC) {

noOfCourses = noOfC;

for (int i=0; i<noOfCourses; i++) {

courses[i] = c[i];

}

}

void setGrades(const char cG[], int noOfC) {

noOfCourses = noOfC;

for (int i=0; i<noOfCourses; i++) {

coursesGrade[i] = cG[i];

}

}

long getID() {

return studentId;

}

string* getCourses() {

return courses;

}

char* getGrades() {

return coursesGrade;

}

studentType(string fName = "", string lastName = "",

long id = 0, string c[] = NULL, char cG[] = NULL, int noOfC = 0);

private:

long studentId;

string courses[6];

char coursesGrade[6];

int noOfCourses;

};

Explanation:

Code rewritten

5 0
3 years ago
Other questions:
  • What could prevent earmuffs from providing your ears good protection from noise?
    10·1 answer
  • Gateway drugs are normally not addictive
    15·2 answers
  • Which is the correct formula to add the values in cells A1 and B1? A. SUM(A1+B1) B. =SUM(A1+B1) C. =SUMA1+B1 D. A1+B1
    9·2 answers
  • Classes cannot:
    10·1 answer
  • What function should be entered into B7 to calculate the total budget
    15·2 answers
  • technology might not possess emotional intelligence but it can certainly influence ours. how have technological changes affected
    7·1 answer
  • Why computer manufacturers constantly releasing faster computers ?
    14·1 answer
  • palindrome is a string that reads the same forwards as backwards. Using only a xed number of stacks, and a xed number of int and
    15·1 answer
  • 19. Fatigue can help improve your reaction time.<br> False<br> O True
    8·2 answers
  • 23. Convert the following to Megabytes<br> a) 2GB<br> b) 2056 Bytes-
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!