Solved

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

Posted on 2008-10-24
2
746 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
Comment Utility
One way would be...

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

Author Closing Comment

by:brgdotnet
Comment Utility
Thank you. Good job
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

12 Experts available now in Live!

Get 1:1 Help Now