Ask Question
12 August, 07:49

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.

+5
Answers (1)
  1. 12 August, 10:23
    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?
Find 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 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