Ask Question
12 February, 01:28

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?

+3
Answers (1)
  1. 12 February, 01:35
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers