write a program to accept two different characters and display the sum and difference of their ASCII values
Answers
Answered by
16
class ASCII_Sum
{
static void teja(String st)
{
int l = st.length();
int s = 0;
for(int i = 1;i<l;i++)
{
char ch = st.charAt(i);
int p = (int)ch;
for(int j = 65,h=97;j<=90;j++,h++)
{
if(p==j||p==h)
s=s+p;
else
s=s;
}
}
System.out.println(“Sum is “+s);
System.out.println(“Character of “+s+” is “+(char)s);
}
}
gamer222:
no prob
Answered by
37
so here is your answer
hope it helps you
Attachments:
Similar questions