Securing Higher Grades Costing Your Pocket? Book Your Assignment at The Lowest Price Now!

GET ASSIGNMENT HELP

Write a program that allows you to input the following data

  • Firstname
  • Surname
  • Address
  • Age (declare as string) then convert to integer.

Procedure:-

1. Go to File -> Take New Project, Select Window Classic DesktopConsole App (.Net Framework).
2. Declare Four Variable (name, surname, address, age).
3. name, surname, address  and age as string value .
4. Console.Write(“ “) is used to Write the data.
5. Enter data will read and Store in variable which is declared above.
6. After Entering all value the output will print.
7. But in age, declare it as string then convert to integer.
8. To  convert string value to integer 
  Convert.ToInt32(Console.ReadLine()).

Code :-

using System;
namespace ConsoleApp1
{
public class Program
{
public static void Main()
{
string name;
string surname;
string address;
string age;
Console.Write("Name: ");
name = Console.ReadLine();
Console.Write("Surname: ");
surname = Console.ReadLine();
Console.Write("Address: ");
address = Console.ReadLine();
Console.Write("Age: ");
age = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.WriteLine("The Output is:-");
Console.WriteLine("Name :- {0}.", name);
Console.WriteLine("Surname :- {0}.", surname);
Console.WriteLine("Address :- {0}.", address);
Console.WriteLine("Age :- {0}.", age);
}
}
}

Output

Write a program that allows you to input the following data
Assignment Help Features
Assignment Help Services
  • Assignment Help
  • Homework Help
  • Writing Help
  • Academic Writing Assistance
  • Editing Services
  • Plagiarism Checker Online
  • Proofreading
  • Research Writing Help
QR Code Assignment Help
elearningfeeds