I want to make a simple program
that :
reads numbers in a one line and storing
it in a Long variable ,then i want to
examine the entered number
and add the odd numbers
in a variable ?!
and i try to write some code :
import java.util.Scanner;
public class Odd
{
public static void main(String[] args)
{
Scanner input=new Scanner(System.in);
int counter=0;
long y=0;
long num=input.nextLong();
if (num%2 !=0)
{
System.out.println(num);
}
but it came to nothing

New Topic/Question
Reply




MultiQuote





|