|
-
October 16th, 2009, 02:42 AM
#1
Simple C# Programming doubt (Beginner)
I am building a program with Name, Roll No., Marks in different subjects, Total and Average.........I haven't yet finished and before that I have some doubts. Please help
class Report
{
static void Main ()
{
string s = " ";
int a;
/*,c,d,e,f,g,h,i;*/
Console.WriteLine ("Enter the Name:");
s= Console.ReadLine ();
Console.WriteLine ("Enter the Roll No.:");
a=Convert.ToInt32(Console.ReadLine ());
/*
Marks in English:\nMarks In Hindi:\nMarks in Maths:\nMarks in Social:\nMarks in G.K.:\n");
b=Convert.ToInt32(Console.ReadLine ());
c=Convert.ToInt32(Console.ReadLine ());
d=Convert.ToInt32(Console.ReadLine ());
e=Convert.ToInt32(Console.ReadLine ());
f=Convert.ToInt32(Console.ReadLine ());
g=Convert.ToInt32(Console.ReadLine ());
h=Convert.ToInt32(Console.ReadLine ());
i=Convert.ToInt32(Console.ReadLine ());*/
}
}
When I am asked to enter name it is not coming on the side ways
it is coming like this
Enter the Name:
Jonah
I want it to come in this way
Enter the Name: Jonah
please help what I must do to make my input name to be typed just beside " Enter the Name:" instead of next line.
thanks
-
October 16th, 2009, 03:16 AM
#2
Re: Simple C# Programming doubt (Beginner)
Change
Code:
Console.WriteLine ("Enter the Name:");
to
Code:
Console.Write("Enter the Name:");
WriteLine writes a line : i.e. inserts a newline at the end of the text.
Darwen.
-
October 16th, 2009, 03:51 AM
#3
Re: Simple C# Programming doubt (Beginner)
Thanks dude.
Thank You Very Much
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|