#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Multiplication of hexadecimal

Member Posts: 2
Anyone know how to create a program that will multiply two hexadecimals.
But the program needs to have the following: array, pointers, and functions. I really need help

## Comments

• Member Posts: 14
: Anyone know how to create a program that will multiply two
: hexadecimals.
: But the program needs to have the following: array, pointers, and
: functions. I really need help

in order to input number as hex/dec/oct use cin >> hex/dec/oct >> int_number
in order to multiply do it as you normally do it
in order to display number as hex/dec/oct use cout << hex/dec/oct << int_number

The following code snippet is just an example though it compiles and
works properly.

#include <iostream>
using namespace std;

int main ()
{
int n1,n2,result;

cout <<"First Hex Number :";
cin >> hex >> n1;

cout << endl;

cout <<"First Hex Number :";
cin >> hex >> n2;

result = n1*n2;

cout << hex << n1 << endl;
cout << hex << n2 << endl;
cout << hex << result<< endl;

return 0;
}

• Member Posts: 14
: Anyone know how to create a program that will multiply two
: hexadecimals.
: But the program needs to have the following: array, pointers, and
: functions. I really need help

in order to input number as hex/dec/oct use cin >> hex/dec/oct >> int_number
in order to multiply do it as you normally do it
in order to display number as hex/dec/oct use cout << hex/dec/oct << int_number

The following code snippet is just an example though it compiles and
works properly.

#include <iostream>
using namespace std;

int main ()
{
int n1,n2,result;

cout <<"First Hex Number :";
cin >> hex >> n1;

cout << endl;

cout <<"First Hex Number :";
cin >> hex >> n2;

result = n1*n2;

cout << hex << n1 << endl;
cout << hex << n2 << endl;
cout << hex << result<< endl;

return 0;
}

• Member Posts: 14
: Anyone know how to create a program that will multiply two
: hexadecimals.
: But the program needs to have the following: array, pointers, and
: functions. I really need help

in order to input number as hex/dec/oct use cin >> hex/dec/oct >> int_number
in order to multiply do it as you normally do it
in order to display number as hex/dec/oct use cout << hex/dec/oct << int_number

The following code snippet is just an example though it compiles and
works properly.

#include <iostream>
using namespace std;

int main ()
{
int n1,n2,result;

cout <<"First Hex Number :";
cin >> hex >> n1;

cout << endl;

cout <<"First Hex Number :";
cin >> hex >> n2;

result = n1*n2;

cout << hex << n1 << endl;
cout << hex << n2 << endl;
cout << hex << result<< endl;

return 0;
}

• Member Posts: 14
: Anyone know how to create a program that will multiply two
: hexadecimals.
: But the program needs to have the following: array, pointers, and
: functions. I really need help

in order to input number as hex/dec/oct use cin >> hex/dec/oct >> int_number
in order to multiply do it as you normally do it
in order to display number as hex/dec/oct use cout << hex/dec/oct << int_number

The following code snippet is just an example though it compiles and
works properly.

#include <iostream>
using namespace std;

int main ()
{
int n1,n2,result;

cout <<"First Hex Number :";
cin >> hex >> n1;

cout << endl;

cout <<"First Hex Number :";
cin >> hex >> n2;

result = n1*n2;

cout << hex << n1 << endl;
cout << hex << n2 << endl;
cout << hex << result<< endl;

return 0;
}

• Member Posts: 14
: Anyone know how to create a program that will multiply two
: hexadecimals.
: But the program needs to have the following: array, pointers, and
: functions. I really need help

in order to input number as hex/dec/oct use cin >> hex/dec/oct >> int_number
in order to multiply do it as you normally do it
in order to display number as hex/dec/oct use cout << hex/dec/oct << int_number

The following code snippet is just an example though it compiles and
works properly.

#include <iostream>
using namespace std;

int main ()
{
int n1,n2,result;

cout <<"First Hex Number :";
cin >> hex >> n1;

cout << endl;

cout <<"First Hex Number :";
cin >> hex >> n2;

result = n1*n2;

cout << hex << n1 << endl;
cout << hex << n2 << endl;
cout << hex << result<< endl;

return 0;
}

Sign In or Register to comment.