Write a program to input any two characters in variable x and y. Add
the ASCII code of both characters. Also find the greater ASCII value from x and y.
Answers
Answered by
0
#include<stdio.h>
int main()
{
char x,y;
int a,b,sum=0;
scanf("%c %c",&x,&y);
a=x;
b=y;
printf("a=%d\tb=%d\n",a,b);
sum=a+b;
printf("Sum of ASCII values of the character=%d\n",sum);
if(a>b)
{
printf("x has the greatest ASCII value\n");
}
else
{
printf("y has the greatest ASCII value\n");
}
return 0;
}
Similar questions