Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2011, 07:34 AM
Registered User
 
Join Date: Jun 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Ch3 Ex2 Console.WriteLine question

Hello fellow programmers,
I have just decided to switch my major to computer science and am reading through this book in addition to starting this next semester. So I am a beginner and just started :D Love it so far. Anyways here is my question:

Is there a way to put in a return command within the parenthesis of the first part of Console.WriteLine?

Here's the original code:

Code:
Console.WriteLine("Now give me another number:");
Here is what I want to know is possible or not and how if I can do it....

Code:
Console.WriteLine("Now give me 
          another number:");
Does that part of code have to be on one line??


The reason I am wanting to know this is to make the code work with a revamp. I was revamping the project just to see if I could (hands on learning/tinkering)
 
Old June 11th, 2011, 08:07 AM
Wrox Author
 
Join Date: Sep 2010
Posts: 175
Thanks: 3
Thanked 53 Times in 53 Posts
Default

You can do this:
Code:
Console.WriteLine(
         "Now give me another number:");
or this:
Code:
Console.WriteLine("Now give me " + 
         "another number:");
__________________
Christian
CN innovation
Visit my blog at: csharp.christiannagel.com
Follow me on twitter: @christiannagel
The Following User Says Thank You to ChristianNagel For This Useful Post:
thelafe (June 11th, 2011)
 
Old June 11th, 2011, 08:40 AM
Registered User
 
Join Date: Jun 2011
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ChristianNagel View Post
You can do this:
Code:
Console.WriteLine(
         "Now give me another number:");
or this:
Code:
Console.WriteLine("Now give me " + 
         "another number:");
Thank you so much Christian. I was consolidating a bunch of Console.WriteLines to accomplish the same outcome within that program just to see if it was possible. I will write this down in my notes. More questions will come in the following months! :D

Last edited by thelafe; June 11th, 2011 at 01:32 PM.. Reason: typo





Similar Threads
Thread Thread Starter Forum Replies Last Post
writeline to an application Vinny_68 Pro Visual Basic 2005 0 April 16th, 2007 09:40 AM
Problem with First.cs output via Console.WriteLine patrick764 C# 1 November 7th, 2005 03:17 PM
Console.WriteLine ritag ADO.NET 2 February 9th, 2005 11:09 AM
WriteLine Method with no New Line(?) busher Classic ASP Basics 1 January 13th, 2005 12:53 AM
chapter 2 EX2-2 buddytruck BOOK: Beginning Visual C++ 6 0 August 10th, 2004 09:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.