write java program -



write java program -

import java.util.scanner; public class treasure { public static void main(string[] args) { scanner variable=new scanner(system.in); int a,b,c,d,e,f,g,h,i,j; a=variable.nextint(); b=variable.nextint(); c=variable.nextint(); d=variable.nextint(); e=variable.nextint(); f=variable.nextint(); g=variable.nextint(); h=variable.nextint(); i=variable.nextint(); j=variable.nextint(); while(variable%2==0) { system.out.println("its number"+a); system.out.println("its number"+b); system.out.println("its number"+c); system.out.println("its number"+d); system.out.println("its number"+e); system.out.println("its number"+f); system.out.println("its number"+g); system.out.println("its number"+h); system.out.println("its number"+i); system.out.println("its number"+j); } system.out.println("its odd number"); } }

write java programme read 10 int numbers during run time test odd or (if print out number otherwise odd number) i'm allowed utilize (while- while - for)

because i'm in mood of doing homework assignments ! code should :

scanner variable=new scanner(system.in); int counter=0; while(counter<10) { if(variable.nextint()%2==0){ system.out.println("its number."); } else { system.out.println("its odd number."); } counter++; }

java

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -