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

VS2013 Dynamically create chart c#
.UpdateLayout() throwns an exception from RunWorkerCompleted method
Unix to Dos Conversion in C#
How to fill a textbox by using another textbox textchanged event?
NHibernate How do i put data in many to many mapping
Is there a way to use the Windows Form table in a Razor view cshtml?
Round robin pub/sub with StackExchange.Redis
Check if 'Restrict background data' is active on Windows Phone
XMLHttpRequest: Network Error Access is denied
MongoDB EC2 C# Upload Issues - Missing Key?
ASP.Net Web API Validation Attributes on DTO?
Microsoft Solver Foundation could not solve my model in some cases
How to change the column names of a mapping table?
Custom Button doesn't show its content properly
Programmatically get the location set up in regional settings
Can I hide an icon on a Ribbon for particular users?

Categories

HOME
oauth-2.0
actionscript-3
javafx
oracle-sqldeveloper
gsm
customization
formatting
pelican
grpc
cryengine
squeak
crash
opc-ua
opengl-es
angularjs-directive
opacity
travis-ci-cli
gnuradio
scapy
vsixmanifest
webpack-dev-server
box-api
core-data
lambda-calculus
responsive
web-worker
greensock
k-means
geography
project-reactor
legend-properties
udeploy
single-page-application
ajaxcontroltoolkit
dev-c++
bootstrap-accordion
apdu
aspxgridview
scrapy-spider
jira-zephyr
inspec
smart-device
utc
formtastic
cloudformation
typeclass
units-of-measurement
ocl
foxpro
akamai
circle
favorites
respect-validation
server-side-swift
susy
redbean
electron-packager
bzip2
head
chrome-custom-tabs
xmldom
emacs24
import.io
denodo
django-tables2
cancan
visio-2010
htop
scanf
addressbook
consolidation
joystick
avaudiorecorder
user-profile
window.location
paypal-subscriptions
askbot
github-for-mac
wiql
page-flipping
pushwoosh
bootstrap-tabs
vspackage
tinymce-plugins
gcc-warning
firebase-tools
cl.exe
douglas-peucker
backtrace
indices
random-access
information-hiding
system.io.packaging
breeze-sharp
zoneminder
gnip
indic
triplestore
scjp
pyalgotrade
hotlinking
power-management
connections
cvi
nativequery
randomaccessfile
dylan
ironworker
wpd
symbian3
gmail-imap
blotter
vline
jmesa
jqueryi-ui-buttonset
mismatch
object-tag
marathontesting
oaw
carbon-emacs
script-tag

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