Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

In C# how to print an integer to the screen using Console.WriteLine

Posted on 2008-10-24
2
Medium Priority
?
775 Views
Last Modified: 2012-05-05
In C# how do put output to the DOS console for an integer. Refer to the code below that won't work:
int theLength=50;
Console.WriteLine("The length of the string is" + theLength) // This code won't work;
0
Comment
Question by:brgdotnet
2 Comments
 
LVL 21

Accepted Solution

by:
mastoo earned 400 total points
ID: 22796401
One way would be...

Console.WriteLine("The length of the string is" + theLength.ToString())
0
 
LVL 2

Author Closing Comment

by:brgdotnet
ID: 31509660
Thank you. Good job
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question