Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Lisa Anderson   on Apr 26 In Java Category.

  
Question Answered By: Sonya Flores   on Apr 26

something like this maybe..........

System.out.println("Pleaser enter two numbers");
int num = 0;
char ch = System.in.read();
char ch2 = System.in.read();
if(ch>='0' && ch<='9' && ch2>='0' && ch2<='9')
num = (ch-'0') * 10 + ch2 - '0';
else System.out.println("I said a number you fool");

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Need to convert an integer input to a text output Or get search suggestion and latest updates.


Tagged: