write a program to accept three integer and check whether the last digit of every number is 7 or not
raj960:
yes
Answers
Answered by
1
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.
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.
Similar questions