Index » Programming » C/C++ » C++,binary calculator john 2 Oct 08, 4:29PMParent PostC++,binary calculatorSounds simple: char str[20]; // Must be big enough to hold entire random number srand ( time(NULL) ); // initialise random seed double a= rand() % 10 + 1; // generate number 1 to 10 in this case itoa(a, str, 2);