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

set SelectionChanged in ListView Clickmode = “pressed” in uwp
Get radio button list responses with data source asp.net
Is it possible to have a generic type derived from another generic type in C#?
IUnknown_SetSite reference counter behavior
Populate WPF treeview in separate thread
if combobox text changed reset all the textbox in the form
How do I convert this Integer (1486993620) to DateTime in C#? [duplicate]
How to use Pkcs11Interop with an NitroKey HSM to derive an shared secret with an EC
Unable to move Mail items of different Item classes from the same folder using EWS
Iterating DataSet Tables
Amazon AWS Timestamp must be in ISO8601 format
Regex back-reference replace oddity
Unity: Animator Component has a warning dialog in play mode that result in making a humanoid character in T pose
How to Display PDF Files
PFXExportCertStoreEx failed with exception NTE_BAD_KEYSET
C#: How can i store the values selected in checklistbox to an array

Categories

HOME
c#
asp.net
pact
gcc
mobile
process
openacc
ldap
azure-eventhub
microcontroller
python-requests
okhttp3
redhawksdr
browser-cache
sahi
segmentation-fault
wkhtmltopdf
wowza
novacode-docx
hl7-fhir
custom-component
multipart
tcpdf
infinite-loop
functional-dependencies
ps
gsuite
core-animation
scalatest
nsopenpanel
smart-device
multiple-inheritance
hierarchical-data
emr
paper-trail-gem
openoffice-impress
vtd-xml
akamai
ios-autolayout
jql
urhosharp
headphones
sdl-2
iterm2
origami
mybatis-generator
jslider
usernotifications
susy
directadmin
irr
binary-decision-diagram
grails-2.0
html-entities
amazon-fire-tv
piranha-cms
automapper-4
bioperl
printer-control-language
node.js-client
scrollmagic
qt3d
blitz3d
kik
django-celery
datamodel
ruby-1.8.7
event-tracking
jain-sip
azure-mobile-app
pagecontrol
httpmodule
nexusdb
douglas-peucker
qxorm
fedena
jsonmodel
pytz
drawable
iwork
fastcgi-mono-server
mongoid4
surfaceview
fade
ie-developer-tools
infinity.js
pageload
ftpwebrequest
rfc822
derived-class
databus
php-gettext
google-email-audit-api
beep
winrt-async
towerjs
visual-leak-detector
zend-validate
mscorlib
quazip
viewdata
nscharacterset
database-agnostic
silverlight-2.0
webdb
uccapi
konsole
dgml
lts
dynamic-scope
mdd
djangoappengine
unauthorized

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