FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SampleCodes/Java-Programs/If Statement/Question1_B.java at main · ajacreations/SampleCodes · GitHub
ajacreations
/
SampleCodes
Public
Notifications
You must be signed in to change notification settings
Fork
27
Star
5
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SampleCodes
/
Java-Programs
/
If Statement
/
Question1_B.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (22 loc) · 492 Bytes
Breadcrumbs
SampleCodes
/
Java-Programs
/
If Statement
/
Question1_B.java
Copy path
File metadata and controls
24 lines (22 loc) · 492 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
B) Given two non-negative int values, print true if they have the same last digit,
such as with 27 and 57.
*/
public
class
Question1_B
{
public
static
void
main
(
String
args
[])
{
int
num1
=
Integer
.
parseInt
(
args
[
0
]);
int
num2
=
Integer
.
parseInt
(
args
[
1
]);
int
rem1
=
num1
%
10
;
int
rem2
=
num2
%
10
;
if
(
rem1
==
rem2
)
{
System
.
out
.
println
(
"lastDigit("
+
num1
+
","
+
num2
+
")->True"
);
}
else
{
System
.
out
.
println
(
"lastDigit("
+
num1
+
","
+
num2
+
")->False"
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL