Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I read alot on google how to use /n or Environment.NewLine yet this is not exactly what im looking for;

Syntax:

int num1, num2, num3

Console.Write("Input First Number to Multiply:");
num1 = Convert.ToInt32(Console.ReadLine(();

Console.Write("Input Second Number to Multiply:");
num2 = Convert.ToInt32(Console.ReadLine(();

Console.Write("Input Third Number to Multiply:");
num2 = Convert.ToInt32(Console.ReadLine(();

-----------------------------------------------------

What i want in Command;

Input First Number to Multiply:
4
Input Second Number to Multiply:
2
Input Third Number to multiply:
2
____________________________________________________

What i get:


Input First Number to Multiply:4
Input Second Number to Multiply:2
Input Third Number to multiply:2

What I have tried:

Environment.NewLine messes up my Integers - Google wasnt as helpful as i hoped it would be.
Posted
Updated 6-Dec-16 4:33am

Your /n or Environment.NewLine will not help in this case, You should use
C#
Console.WriteLine("Input First Number to Multiply:");
instead of your code
C#
Console.Write("Input First Number to Multiply:")


Learn the difference between Console.WriteLine() and Console.Write()




Hope this Helps You
 
Share this answer
 
Just use
C#
Console.WriteLine("Input First Number to Multiply:");

which will add a newline.
There are quite a number of typo errors like missing closing bracket, and num3 was not used.
 
Share this answer
 
v2
C#
Console.Writeline("Input First Number to Multiply:");


C#
http://www.c-sharpcorner.com/interview-question/what-is-the-difference-between-systemconsolewriteline-and-systemconsolewrite-functionexample
 
Share this answer
 
v2
Comments
Peter Leow 6-Dec-16 9:38am    
Should be Console.WriteLine()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900