1.

Wap to enter any 50 numbers and check whether they are divisible by 5 or not ​

Answer»

rogram{public static VOID main(){Scanner sc=new Scanner(System.in);System.out.println("Enter 50 NUMBERS ");for(int i=0;i<=50;i++){int a =sc.nextInt();}int s=0;if(a%5==0){if(a%10==5){System.out.println("the numbers ENDING with 5 are:"+a);}if(a%10==0){s+=1;}System.out.println(s+"digits end with 0");}}}



Discussion

No Comment Found