Ask Question
14 March, 16:24

Write a program that inputs the following information from the user, using the Win32 Read-Console function: first name, last name, age, phone number. Redisplay the same information with labels and attractive formating, using Win32 WriteConsule function.

+3
Answers (1)
  1. 14 March, 18:19
    0
    Following are program using c#

    using System;

    class detail

    {

    static void Main () / / main function

    {

    string first_name, last_name, number1; / / variable declaration

    int age1; / /variable declaration

    Console. WriteLine ("Enter the First Name ");

    first_name = Console. ReadLine (); / / read input by win32

    Console. WriteLine ("Enter the Last Name ");

    last_name = Console. ReadLine (); / / read input by win32

    Console. WriteLine ("Enter the Age ");

    age1 = Int32. Parse (Console. ReadLine ()); / / read input by win32

    Console. WriteLine ("Enter the Phone Number ");

    number1 = Console. ReadLine (); / / read input by win32

    Console. WriteLine ("Following are the data which are entered ");

    Console. WriteLine ("First Name : "+first_name); / / display data

    Console. WriteLine ("Last Name : "+last_name); / / display data

    Console. WriteLine ("Age : "+age1); //display data

    Console. WriteLine ("Phone Number:"+number1); / / display data

    }

    }

    Explanation:

    In this program we have declared first_name, last_name, number1 variable as the string type and age1 as integer type after that we are taking input from user by win32 Read console i. e Console. ReadLine () function and finally printed the same information.

    Output:

    Enter the First Name

    san

    Enter the Last Name

    lan

    Enter the Age

    45

    Enter the Phone Number

    9045454545

    Following are the data which are entered

    First Name : san

    Last Name : lan

    Age : 45

    Phone Number : 9045454545
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that inputs the following information from the user, using the Win32 Read-Console function: first name, last name, age, ...” 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