c#


The last statement won't run c#! [duplicate]


This question already has an answer here:
Why is the console window closing immediately without displaying my output?
18 answers
Please help! I ran this program and entered all 3 inputs but the last writeline code wouldn't run and the program just exits itself! I have no idea because I follow the book exactly!
string userName = "";
int userAge = 0;
int currentYear = 0;
Console.Write("Please enter your name: ");
userName = Console.ReadLine();
Console.Write("Please enter your age: ");
userAge = Convert.ToInt32(Console.ReadLine());
Console.Write("Please enter the current year: ");
currentYear = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Hello World! My name is {0} and I am {1} years old. I was born in {2}.", userName, userAge, currentYear - userAge);
at the end of the code add:
Console.ReadLine();

Related Links

SelectNextControl not working on telerik drop down list
Nested loop (level: beginner)
Xamarin - how to change image source dynamically?
OOP Fundamental - C# Refactoring?
How can i make that when the player is getting close to a waypoint he will slow down and then will speed up again?
How to Prevent user entries in Bot Chat text window C#
Plot a contour in chart(mainly algorithm) in c# WPF
Func/Action vs. local functions [duplicate]
entity hasoptional foreign keyone to one
OpenSSL.NET decrypting with GOST using c#
Mailkit: Could I get the original sender from a forwarded e-mail?
JavaScript way to convert C# List<string> value?
Notifications for WinForms / WPF application
Hashing Json result to detect changes
Using classes exported by C# dll in Delphi
Taking screenshot of dynamically opened windows form c#

Categories

HOME
repository
youtube-api
twitter-bootstrap
azure-active-directory
itunesconnect
network-programming
pelican
snappy
casting
windows-server-2008
postsharp
magento-1.9.2.1
crm
spss
confluence-rest-api
sugarcrm
ms-access-2010
powerquery
markdown
phpexcel
oms
openbsd
select2
adroitlogic
watson-dialog
fastreport
lambda-calculus
amazon-data-pipeline
simd
openam
google-street-view
hl7-fhir
git-branch
xna
gnu-screen
concatenation
quality-center
advertising
pydub
ballerinalang
meteor-accounts
pypy
javapns
jms-topic
pushpad
ios9
wordpress-rest-api
wercker
kubectl
directions
postgresql-9.6
border-layout
kofax
strategy-pattern
anypoint-studio
dotnetnuke-module
azure-web-roles
electron-packager
google-cloud-powershell
firefox-developer-edition
ocpjp
ocamlbuild
qtwebkit
line-endings
jks
automapper-4
jcs
programming-pearls
dmalloc
printer-control-language
stripes
android-tabs
vga
syslog4j
skbio
ooad
encode
controlpanel
ios8-share-extension
transbase
avrcp
playn
parseexception
crystal-reports-7
dojox.grid
famous-engine
gnip
msdropdown
nspopupbutton
cs193p
lettuce
elixir-framework
dayofweek
mysql-error-1146
grunt-contrib-imagemin
friendly-id
ironworker
panelgrid
bho
boost.build
junit-rule
jquery-1.8
sup
nude.js
diazo
advanceddatagrid
stl-algorithm
mcpd
soapexception
text-manipulation
table-valued-parameters
jquery-attributes
xslt-grouping
linq-to-mysql
qprocess
djangoappengine
bootstrap-protocol
content-delivery-network
moores-law
urlscan

Resources

Encrypt Message