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

Windows Phone ListPicker selectedItem without databinding
Issue related to a console application in C#/NET
Guessing a word within 3 tries. If failed in 3rd try, continue to next statement
RadComboBox pre selection
Windows Forms Logins
How to get simple url var with Razor MVC 4? [duplicate]
Why does disassembler/disassembly-window pops up sometimes when I debug my asp.net website?
DragDrop disables MouseMove Event?
Inserting data into sql server fails with no reason
Is it reasonable to wrap a domain's BLL into it's own Class Library, and how would I set it up?
Substring with dynamic length
MVC Shared Partial Views using different controllers and models
Linq type conversion delegate for .First method
programmatic defined # foreach loops c#
Resource File lookup with variable
ThreadPool and delegate action - WaitHandle.WaitAll()

Categories

HOME
marie
stanford-nlp
packet
casting
reference
gaussian
arcgis
sms
glympse
rmarkdown
sahi
theory
logstash-configuration
background-image
powerpivot
ibatis
cucumberjs
alert
audio-streaming
angular2-pipe
knapsack-problem
multiple-inheritance
marionette
csproj
dynamics-ax-2012-r3
key-bindings
epub
voyager
incapsula
geocomplete
aweber
hippocms
libconfig
jquery-inputmask
nsdateformatter
wicket-tester
android-graphview
aspnetboilerplate
gridgain
ocpjp
jcs
e4
nservicebus6
typewriter
node.js-client
disassembly
addressbook
ownership
computed-properties
zsh-completion
universe
particle-system
hfp
nimbus
bytearray
nsoperationqueue
supervised-learning
archiva
video-embedding
alchemy
android-facebook
random-sample
identifying
pushwoosh
cloud-storage
syncano
android-filterable
minko
conkeror
crtdbg.h
xmlserializer
gnip
nsmutableurlrequest
pyalgotrade
episerver-7
visual-studio-setup-proje
satisfiability
android-jack-and-jill
8-puzzle
brew
esi
xcode4.6.3
certificate-revocation
aspmenu-control
sup
arraycollection
chars
oaw
dongle
mysql-logic
web-widget
appointment
pkcs#7
zend-acl
wtsapi32

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile