Hexadecimal to Decimal Conversion” is one of the classic programming problem exercise. Here, we are given a hexadecimal number, entered by user and our task is to write a program to convert the hexadecimal number to its equivalent decimal number.

Hexadecimal Numbers uses 16 values to represent the number. Numbers from 0-9 are expressed by digits 0-9 and 10-15 are represented by characters from A – F

#### Examples (Hexadecimal to Decimal Conversion):

```Hexadecimal = A
Decimal = 15
Decimal = 78```

The steps required to convert hexadecimal number into decimal number are as follows:

1. Take Iterator = 1 and Decimal = 0.
2. Read the given hexadecimal string in reverse order character by character.
3. If the character encountered is digit between 0 to 9, then convert it into number by subtracting 48 from it and store the result into temp.
4. Else, if the character encountered is between ‘A’ to ‘F’, then convert it into number by subtracting 55 from it and store the result into temp.
5. Decimal = Decimal + temp*iterator.
6. Multiply the iterator by 16.
7. Repeat the steps from 2 to 6 for all the characters of the hexadecimal string.
8. Print the result.

#### C++ Program for Hexadecimal to Decimal Conversion is as follows:

```/* C++ Program for Hexadecimal to Decimal Conversion */
#include<bits/stdc++.h>
using namespace std;
int main()
{
/* Scan the Hexadecimal Number */

int Decimal = 0;
int iterator = 1;
for(int i = size - 1; i >= 0; i--)
{
int temp;
{
}
else
{
}
Decimal = Decimal + temp*iterator;
iterator = iterator * 16;
}

/*Printing the result */
cout<<"The Decimal of "<<Hexadecimal<<" is "<<Decimal;
}

```
```OUTPUT: