Ask Question
6 September, 03:49

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. 6 September, 05:16
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers