FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SampleCodes/Java-Programs/If Statement/Question5.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
/
Question5.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (25 loc) · 585 Bytes
Breadcrumbs
SampleCodes
/
Java-Programs
/
If Statement
/
Question5.java
Copy path
File metadata and controls
29 lines (25 loc) · 585 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
25
26
27
28
29
/*
Initialize a character variable in a program and
print 'Alphabhet' if the initialized value is an alphabhet,
print 'Digit' if the initialized value is a number, and
print 'Special Character', if the initialized value is anything else.
*/
public
class
Question5
{
public
static
void
main
(
String
args
[])
{
char
ch
=
' '
;
if
(((
ch
>=
65
)&&(
ch
<=
90
))||((
ch
>=
97
)&&(
ch
<=
122
)))
{
System
.
out
.
println
(
"Alphabet"
);
}
else
if
((
ch
>=
48
)&&(
ch
<=
57
))
{
System
.
out
.
println
(
"Digit"
);
}
else
{
System
.
out
.
println
(
"Special Character"
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL