Live Webinar: Prompt Engineering: Skill Everyone Must Learn Today
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Name and age display in c#
WhatsApp
Vijayaragavan S
Aug 05
2016
31.4
k
0
0
using System;
class Program
{
static
void Main()
{
int
a;
string b, c, d;
//
Read
a
name
Console.Write(
"Enter your name : "
);
b=Console.ReadLine();
//
Read
Age
Console.Write(
"Enter your age : "
);
a =
Convert
.ToInt16( Console.ReadLine());
//Display formatted
output
Console.WriteLine(
"Your name is "
+ b +
", age is "
+ a);
//Waiting fot
output
view
Console.ReadKey();
}
}
C# basics
Reading input from the user
console Application
Up Next
Name and age display in c#