C + + program to input two hexadecimal nos and display their sum in octal form
.....include the header files iostream.h and conio.h........
int main ( )
{
int a,b;
clrscr( );
cout< < "enter two hexadecimal nos ";
cin > >hex > >a > >b ;
int sum=a+b;
cout < <" sum is in octal form ="< < oct < < sum;
getch( );
return 0;
}
Sunday, August 3, 2008
Subscribe to:
Posts (Atom)
