1.

Write a program to accept three integer and check whether the last digit of every number is 7 or not

Answer»

Import java.util.*;
class number
{
PUBLIC static void main()
{
Scanner in=new Scanner(System.in);
int n1,n2,n3;
System.out.println("ENTER THREE numbers");
n1=in.nextInt();
n2=in.nextInt();
n3=in.nextInt();
if(n1%10==7&&n2%10==7&&n3%10==7)
System.out.println("All three numbers have 7 at their end");
else
System.out.println("All three numbers don't have 7 at their end");
}
}



Comment if u need to find 7 for each number individually.
Also comment if u didn't understand any step. I'll do my best to explain.
And PLEASE, just give me a thank you.



Discussion

No Comment Found