What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-01 21:31:26
c++ random between two values
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand(time(0)); // Initialize random number generator. cout&l... Add solution -
Other 2021-11-20 18:07:17
enrolled in a yearly course has incorrect --data in records with ids between 20 and 100 (inclusive)
--------------------------------------------------------- --A table containing the students enrolled in a yearly course has incorrect --data in records with ids between 20 and 100 (inclusive). DROP TABLE IF EXISTS enrollments; CREATE TABLE enrollments ... Add solution -
C++ 2021-11-20 07:13:08
c++ guess my number
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int num, guess, tries = 0; srand(time(0)); //seed random number generator num = rand() % 100 + 1; // random number between 1 and 100 cout <... Add solution -
C++ 2021-11-19 14:25:09
how to get a random element from a vector c++ string
#include <iostream> #include <vector> using std::string; int main() { std::vector <string> some_vector {"pizza", "burger", "fries", "chicken"}; string random = some_vector[rand() % some_v... Add solution