Solved

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

Posted on 2008-10-24
2
747 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 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now