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

Importing Pyro in IronPython ScriptEngine
Linq query to check substring between a list and string
String builder returning the same values
Show resx translation key names on page
C# Linq XML InvalidOperationException
Why does System.Net.Http not get packaged? [duplicate]
Azure Service Bus Topic subscribe from CRM plugin
Method and field in parent or base class [closed]
Mesh Decimation (averaged face value?) + triangulation | .NET/C# library
Enable button only if two ListViews have at least 1 item (via WPF Triggers)
Convert custom DateTime string to DateTime object [duplicate]
c# jagged multidimensional jagged array type name does not appear correct
Text box is not being set a value
Parsing Jcal data returned from webservice to Ical c#
ASP.net Webpages calendar
How to extract list separator from the possible page range [closed]

Categories

HOME
oauth-2.0
actionscript-3
youtube-api
twitter-bootstrap
kendo-ui
salesforce
android-ndk
file-upload
glsl
postsharp
itext7
assign
redhawksdr
confluence-rest-api
uml-designer
yuv
richtextbox
scapy
subprocess
token
ejb-3.0
point-of-sale
solidity
ng2-charts
mongodb-replica-set
opendaylight
exchange-transport-agents
appsettings
web-worker
loader
audio-streaming
udeploy
spring-webflow
android-wifi
gomobile
dev-c++
advertising
osgi-bundle
delphi-2010
edirectory
xlib
lines
scene7
angularjs-resource
powerbi-embedded
wit-ai
javafxports
iterm2
stdin
mybatis-generator
autodesk-data-management
binary-decision-diagram
colorbox
qt-quick
google-chrome-storage
dna-sequence
jenkins-docker
ajv
android-vectordrawable
try-catch-finally
jtextarea
multi-select
distcc
scriptengine
patching
queuing
aws-kms
usps
controlpanel
webservices-client
jain-sip
windows-phone-8-emulator
firewire
tidesdk
bungeecord
applinks
chunks
pysvn
report-builder2.0
yosemite
dirname
selenium-grid2
ccmenuitem
disabled-control
ant-contrib
sendy
azure-caching
mongoid4
nomachine
xcode5.1
google-oauth-java-client
pechkin
static-class
select2-rails
string-length
urlfetch
metapost
idoc
gssapi
bash4
datasheet
openwrap
symfony-1.2
hs-err
xslt-grouping
rpxnow
qlibrary

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App