C program to scan two Hexadecimal numbers and compute the operation given

#include<stdio.h>
int main()
{
int i,j;
char c;
scanf(“%x %c %x”,&i,&c,&j);
switch(c)
{
case ‘+’:
printf(“%x\n”,i+j);
break;
case ‘-‘:
printf(“%x\n”,i-j);
break;
case ‘*’:
printf(“%x\n”,i*j);
break;
case ‘/’:
printf(“%x\n”,i/j);
break;
}
return 0;
}

C program to scan two Hexadecimal numbers and compute the operation given

స్పందించండి

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / మార్చు )

Twitter picture

You are commenting using your Twitter account. Log Out / మార్చు )

Facebook photo

You are commenting using your Facebook account. Log Out / మార్చు )

Google+ photo

You are commenting using your Google+ account. Log Out / మార్చు )

Connecting to %s