exploring-standard-libraries in C++

PHOTO EMBED

Sun Jan 01 2023 06:40:15 GMT+0000 (Coordinated Universal Time)

Saved by @berasumit611 #c++

/*
 Author:	Internshala
 Module:	Diving into C++ Programming
 Topic:		Standard Libraries
*/

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <unistd.h>
using namespace std;


int main() {

	/* WAP to roll a dice.*/

	int randomValue;

	srand(time(NULL));

	randomValue = (rand() % 6) + 1;		// 1, 2, 3, 4, 5, 6

	cout << "Rolling the dice...\n\n";
	usleep(2000000);

	cout << "You got: " << randomValue;

	return 0;
}
content_copyCOPY

https://github.com/Internshala-Online-Trainings/programming-with-c-and-cpp-v2/blob/master/m4-diving-into-cpp-programming/t3-standard-libraries/exploring-standard-libraries.cpp