programming-examples/c++/Numerical_Problems/C++ Program to Generate Random Hexadecimal Bytes.cpp

18 lines
334 B
C++
Raw Normal View History

2019-11-18 14:44:36 +01:00
#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;
}
/*
Random Decimal Byte:41
Equivalent Hex Byte: 29