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
valina [46]
3 years ago
12

Write a c++ program that accepts a string from the user and then replaces all occurrences of the letter e with the letter x

Computers and Technology
1 answer:
mixer [17]3 years ago
6 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   string str;

   cout<<"Enter the string: ";

   cin>>str;

   for(int i=0;str[i]!='\0';i++){

       if(str[i]=='e'){

           str[i]='x';

       }

   }

   cout<<"the string is: "<<str<<endl;

  return 0;

}

Explanation:

First, include the library iostream for using the input/output instructions.

Create the main function and declare the variables.

Then, use the cout instruction and print the message on the screen.

cin store the string enter by the user into a variable.

After that, take a for loop and if-else statement for checking the condition if the string contains the 'e', then change that alphabet to 'x'.

This process continues until the string not empty.

Finally, print the updated string.

You might be interested in
A file system which used tables to store data is called ?
ira [324]

Answer:

The filesystem table is an array of entries that describe each filesystem implementation that is part of the system image. ... The data field contains any private data that the filesystem needs, perhaps the root of its data structures

5 0
3 years ago
Read 2 more answers
Hi, I'm new. Can someone please tell me how Brainly actually works?
Bad White [126]
You just ask a question and lots of people are nice enough to help out!
6 0
3 years ago
Read 2 more answers
A diskette is divided into concentric circles known as______.
Mademuasel [1]

Answer:

Tracks

Explanation:

A disk is divided into thin concentric circles called tracks. The heads move between the outermost track or zero track to the innermost track.

It is the circular path drawn through the circular surface of the disk plate by the read / write head.

Each track consists of one or more Cluster.

4 0
3 years ago
An artistic technique that creates the appearance of three dimensions on a flat surface.
nadezda [96]

Answer:

atmospheric perspective

4 0
1 year ago
What is the corresponding point of the radian measure pi/2​
MrRissso [65]
It will be 90 degrees.


pi radians is halfway around the circle. Half of pi radians is a quarter around the circle.
6 0
3 years ago
Other questions:
  • Determine the type of plagiarism by clicking the appropriate radio button.
    10·1 answer
  • What is one visual indication that a usb port can be used to charge a mobile device?
    13·1 answer
  • CO! Oher...9
    6·1 answer
  • Which guidelines should be used to make formatting tasks more efficient?
    15·2 answers
  • opearating system protection refers to a mechanism for controling access by programs, processes, or users to both system and use
    7·1 answer
  • PLEASE HELP, THANK YOU SO MUCH!
    13·1 answer
  • Type the correct answer in the box.
    5·1 answer
  • Which blog had legal content and is written mostly by lawyers
    14·2 answers
  • Think of an example in your life where a number could be described as data, information, and knowledge
    14·1 answer
  • _____________________________________________________is a pre-designed format to help users with the creation of a document, lik
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!