1.11M Members

how to read integer value in c#?

 
0
 

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:-|

 
0
 

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

 
0
 

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

 
0
 

If your using a Console app it should be

string strTemp = Console.Readline()

 
0
 

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

 
0
 

int intTemp = Convert.ToInt32(Console.Readline())

 
1
 

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

 
0
 

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

Question Answered as of 7 Years Ago by blacklocist, campkev and Ancient Dragon
 
0
 

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

no prob it is done now thanks for answering;)

 
0
 

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);

 
1
 
int no=(int)Convert.ToInt32(Console.ReadLine());

this ll also work

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article