Skip to content

Commit

Permalink
Maximum Ascii valued character in a String
Browse files Browse the repository at this point in the history
  • Loading branch information
Arijit-SE committed Mar 1, 2023
1 parent 746027d commit e2681f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions MinimumAscii.java → MaximumAscii.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* Find the minimum Ascii valued character in a String
* Arijit = A
* priyanka = a
* Aa = A
/* Find the Maximum Ascii valued character in a String
* Arijit = t
* priyanka = y
* Aa = a
*/

import java.util.*;
public class MinimumAscii {
public class MaximumAscii {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
char ch = s.charAt(0);
for (int i = 0; i < s.length(); i++) {
if(ch>s.charAt(i))
if(ch<s.charAt(i))
{
ch = s.charAt(i);
}
Expand Down

0 comments on commit e2681f0

Please sign in to comment.