Computer Science, asked by jishu7, 1 year ago

write a program to accept two different characters and display the sum and difference of their ASCII values

Answers

Answered by gamer222
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
gamer222: but mark me as brainliest
Answered by Lipsa24
37

so here is your answer

hope it helps you

Attachments:
Similar questions