FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SampleCodes/Java-Programs/If Statement/Question7.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
/
Question7.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (28 loc) · 675 Bytes
Breadcrumbs
SampleCodes
/
Java-Programs
/
If Statement
/
Question7.java
Copy path
File metadata and controls
33 lines (28 loc) · 675 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
30
31
32
33
/*
Initialize a character variable with an alphabhet in a program.
If the character value is in lowercase, the output should be displayed in uppercase in the following format.
Example1)
i/p:a
o/p:a->A
If the character value is in uppercase, the output should be displayed in lowercase in the following format.
Example2)
i/p:A
o/p:A->
*/
public
class
Question7
{
public
static
void
main
(
String
args
[])
{
char
ch
=
'A'
;
if
((
ch
>=
65
)&&(
ch
<=
80
))
{
char
ch1
=
Character
.
toLowerCase
(
ch
);
System
.
out
.
print
(
ch
+
"->"
+
ch1
);
}
if
((
ch
>=
97
)&&(
ch
<=
122
))
{
char
ch1
=
Character
.
toUpperCase
(
ch
);
System
.
out
.
print
(
ch
+
"->"
+
ch1
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL