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
Murljashka [212]
3 years ago
7

Write a function that accepts an argument for a persons name. The method should loop through the number of characters in the nam

e sending each character to the screen each on a separate line.
#include

#include

using namespace std;

int main()

{

Plese fill in.....thanks
Computers and Technology
1 answer:
MatroZZZ [7]3 years ago
4 0

Answer:

#include <iostream>

#include<string.h>

using namespace std;

void printCharacter(string name){

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

       cout<<name[i]<<endl;

   }

}

int main()

{

   string name;

   cout<<"enter the name: ";

   cin>>name;

   printCharacter(name);

}

Explanation:

first include the two libraries iostream for input/output and string library for using the string.

then, create the main function and declare the variable type string.

cout instruction is used o display the message on the screen.

cin is used to store the value in the name variable.

after that, call the function. The program control move to the the function. In the function for loop is used to print the character one by one until end of the name.

You might be interested in
Join me to play mm2<br><br><br>in r0bl0x​
jenyasd209 [6]
Ok what's the code i will join
4 0
2 years ago
Read 2 more answers
Can we change our profile name on here and how
TiliK225 [7]
Only by making a new account
4 0
3 years ago
Read 2 more answers
Which Excel file extension stores automated steps for repetitive tasks?
Marianna [84]

Excel Macros, or .xlsm, stores automated steps for repetitive tasks.

4 0
2 years ago
Read 2 more answers
Why linked list is better than an array?
katrin [286]
In conclusion there are many different data structures. Each data structure has strengths and weaknesses which affect performance depending on the task. Today, we explored two data structures: arrays and linked lists. Arrays allow random access and require less memory per element (do not need space for pointers) while lacking efficiency for insertion/deletion operations and memory allocation. On the contrary, linked lists are dynamic and have faster insertion/deletion time complexities. However, linked list have a slower search time and pointers require additional memory per element in the list. Figure 10 below summarizes the strength and weakness of arrays and linked lists.
8 0
2 years ago
¿El auto es un servicio tecnológico? / The car is a technological service?
EleoNora [17]
A car isn’t technological, It runs on gas. Hopes this helps :p
4 0
3 years ago
Other questions:
  • A. True
    15·1 answer
  • Summarize who you believe cyber criminals are, and why?
    8·1 answer
  • What is the difference between a fragment shader and vertex shader? How do they relate?
    8·1 answer
  • Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than
    7·1 answer
  • Which of the following statements is true with regards to satellite Internet access?
    13·2 answers
  • Explain the importance of mobile computing in communication​
    7·2 answers
  • Once secured a wheelchair may move up to 6 inches in any direction
    6·1 answer
  • The first few lines of a script that say "using" ... that point the code to the right groups are called
    11·1 answer
  • What is a location where the embedded multimedia terminal is connected to both outside and inside wiring​
    7·1 answer
  • 25 points select 3 options!!!!!!!!!!!!!!!!!!!!!!!!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!