Chandu yadav has Published 1163 Articles

C++ Program to Use rand and srand Functions

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 09:06:34

407 Views

Random numbers can be generated in C++ using the rand() function. The srand() function seeds the random number generator that is used by rand().A program that uses rand() and srand() is given as follows −Example Live Demo#include #include #include using namespace std; int main() {    srand(1); ... Read More

Multiple Inheritance in C++

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 09:03:09

5K+ Views

Multiple inheritance occurs when a class inherits from more than one base class. So the class can inherit features from multiple base classes using multiple inheritance. This is an important feature of object oriented programming languages such as C++.A diagram that demonstrates multiple inheritance is given below −A program to ... Read More

C++ Program to Implement Queue using Linked List

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 09:00:06

23K+ Views

A queue is an abstract data structure that contains a collection of elements. Queue implements the FIFO mechanism i.e the element that is inserted first is also deleted first. In other words, the least recently added element is removed first in a queue.A program that implements the queue using linked ... Read More

How to specify the size of the gap between rows in CSS Grid

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:57:03

253 Views

Use the grid-row-gap property to set the size of the gap between rows in CSSExampleLive Demo                    .container {             display: grid;             grid-auto-rows: 50px;             grid-column-gap: 30px;             grid-row-gap: 50px;             background-color: #95A5A6;             padding: 10px;          }          .container>div {             background-color: #F0F3F4;             text-align: center;             padding:10px 0;             font-size: 20px;          }          .ele3 {             grid-column-end: span 2;          }                              1          2          3          4          5          6          

C++ Program to Implement Fisher-Yates Algorithm for Array Shuffling

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:47:18

650 Views

Fisher-Yates algorithm generates a random permutation of the array elements i.e. it randomly shuffles all the elements of an array. All the permutations for the array are equally likely as the Fisher-Yates algorithm is unbiased.A program to implement the Fisher-Yates Algorithm for array shuffling in C++ is given as follows ... Read More

C++ Program to Implement Parallel Array

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:34:31

4K+ Views

A parallel array is a structure that contains multiple arrays. Each of these arrays are of the same size and the array elements are related to each other. All the elements in a parallel array represent a common entity.An example of parallel arrays is as follows −employee_name = { Harry, ... Read More

How to add 5 hours to current time in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:32:37

2K+ Views

To add 5 hours in current time, we will use now() function from MySQL. The syntax is as follows −SELECT date_add(now(), interval some integer value hour);Now, I am applying the above query to add 5 hours to current time. The query is as follows −mysql> SELECT date_add(now(), interval 5 hour); ... Read More

Can a number be used to name a MySQL table column?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:24:12

856 Views

Yes, we can include a number for column name in MySQL. We need to use the symbol backtick, which is as follows( ` `)To understand, we will make a table with the help of CREATE command. Let us create a table −mysql> CREATE table NumberColumnDemo -> ( -> `123` varchar(100) ... Read More

How to save time in milliseconds in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:09:10

3K+ Views

To save time in milliseconds, we can use now(3) function because “milli 3” can be used for te same purpose. Firstly, I will create a table with the help of CREATE command −mysql> CREATE table MilliSecondDemo -> ( -> MyTimeInMillSec datetime(3) -> ); Query OK, 0 rows affected (0.70 sec)Inserting ... Read More

HTML5 video full preload in JavaScript

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 07:58:43

616 Views

Use the oncanplaythrough event to completely preload video. You can try to run the following code.Example                                        Your browser does not support the video element.                      function display() {             alert("Can be played without pausing for buffering.");         }

Advertisements