Ask Question
Today, 06:16

Write an x64 MASM program using ReadConsoleA and WriteConsoleA to prompt the user for their name. The program should then display the user's name surrounded by asterisks. Allow the name to be up to 30 characters long. Example (user input is boldface, and there are 28 asterisks on the top and bottom lines) : What is your name?

+2
Answers (1)
  1. Today, 09:29
    0
    Solution:

    The following program will be run using Read Console A and Write Console A and it also displays the name of the user surrounded by asterisks

    # include

    # include

    using namespace std;

    int main () {

    char name[31];

    cout <<"What is your name? ";

    cin. getline (name, 30,'/n');

    for (int i=1; i<=30; i++) {

    cout<<"*";

    }

    int spaces = 30 - strlen (name) - 1;

    cout<
    for (int space=1; space
    cout<<" ";

    }

    cout<<"*"<
    for (int i=1; i<=30; i++) {

    cout<<"*";

    }

    return 0

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write an x64 MASM program using ReadConsoleA and WriteConsoleA to prompt the user for their name. The program should then display the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers