Saturday, 18 November 2017

C++ Program to Generate Random Hexadecimal Bytes


Code:

#include    iostream
#include    conio.h
#include    stdlib.h

using namespace std;

int main(int argc, char **argv)
{
    int val = rand();
    char Hex[33];
    itoa(val, Hex, 16);
    cout<< "Random Decimal Byte:" << val;
    cout << "\nEquivalent Hex Byte: " << Hex;
}


Output:

Random Decimal Byte:41
Equivalent Hex Byte: 29


More C++ Programs:














100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...