943,963 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 40376
  • C# RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 4th, 2007
0

how to read integer value in c#?

Expand Post »
if i want to read some integer what command i must use
how to do i read and save value in multi dimensional array??

urgently needed:-|
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shadowrider is offline Offline
20 posts
since Feb 2007
Feb 5th, 2007
0

Re: how to read integer value in c#?

maybe this short tutorial will help you. Follow the link near the bottom of the page for other tutorials.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Feb 5th, 2007
0

Re: how to read integer value in c#?

maybe this short tutorial will help you. Follow the link near the bottom of the page for other tutorials.

that link is telling how to read from a file I want to know how to read from keyboard.
Like we have have cin command in c++ and scanf in C
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shadowrider is offline Offline
20 posts
since Feb 2007
Feb 7th, 2007
0

Re: how to read integer value in c#?

If your using a Console app it should be

string strTemp = Console.Readline()
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
blacklocist is offline Offline
87 posts
since Apr 2006
Feb 7th, 2007
0

Re: how to read integer value in c#?

If your using a Console app it should be

string strTemp = Console.Readline()

but i said i wanted to read integer tht will read integer as character
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shadowrider is offline Offline
20 posts
since Feb 2007
Feb 7th, 2007
0

Re: how to read integer value in c#?

int intTemp = Convert.ToInt32(Console.Readline())
Reputation Points: 14
Solved Threads: 19
Posting Pro in Training
campkev is offline Offline
484 posts
since Jul 2005
Feb 7th, 2007
0

Re: how to read integer value in c#?

Click to Expand / Collapse  Quote originally posted by campkev ...
int intTemp = Convert.ToInt32(Console.Readline())
i have also found one other way that is
int n= int.Parse(Console.ReadLine());
thanks pal that is great
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shadowrider is offline Offline
20 posts
since Feb 2007
Feb 7th, 2007
0

Re: how to read integer value in c#?

Crap forgot that he wanted a integer and not a string.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
blacklocist is offline Offline
87 posts
since Apr 2006
Feb 8th, 2007
0

Re: how to read integer value in c#?

Crap forgot that he wanted a integer and not a string.

no prob it is done now thanks for answering
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shadowrider is offline Offline
20 posts
since Feb 2007
Aug 4th, 2011
0
Re: how to read integer value in c#?
hey these codes are working you can debug and use
int sum = 7;
Console.WriteLine("enter an integer for adding");

int a = int.Parse(Console.ReadLine());

sum += a;

Console.WriteLine(sum);
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adem87 is offline Offline
20 posts
since Aug 2011

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: database picture
Next Thread in C# Forum Timeline: AR Virtual Change Room





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC