rakshi1998-blog
rakshi1998-blog
Untitled
1 post
Don't wanna be here? Send us removal request.
rakshi1998-blog · 5 years ago
Link
A java  code to isolate digits or alphabets from a given alphanumeric string with some conditions. Output should be printed according to the input s2 variable.
Input: s1(Alphanumeric string), s2(Integer 0/1).
Output1: If s2=0:- Print sum of all the digits in the string.
             : If s2=1:- Print all the alphabets present in the string.
Output2: “ZERO” if there are all digits in s1 and s2=1 or if there are all characters in s1 and s2=0.
Output3: “NULL” if string s1 is empty.
2 notes · View notes