Ankith Reddy has Published 1070 Articles

Pure Function in C++

Ankith Reddy

Ankith Reddy

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

2K+ Views

Pure functions always return the same result for the same argument values. They only return the result and there are no extra side effects like argument modification, I/O stream, output generation etc.Some pure functions are sin(), strlen(), sqrt(), max(), pow(), floor() etc. Some impure functions are rand(), time() etc.Some programs ... Read More

C++ Program to Implement Vector

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 09:14:02

812 Views

A vector is a dynamic array that can resize itself if an element is inserted or deleted. The vector elements are contained in a contiguous storage and the container handles the storage automatically.A program that implements vectors is given as follows −Example#include #include #include #include ... Read More

Animate CSS flex property

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 09:01:41

979 Views

To implement animation on flex property with CSS, you can try to run the following codeExampleLive Demo                    .box {             display: flex;             background-color: orange;         ... Read More

C++ Program to Perform Complex Number Multiplication

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:49:58

5K+ Views

Complex numbers are numbers that are expressed as a+bi where i is an imaginary number and a and b are real numbers. Some examples on complex numbers are −2+3i 5+9i 4+2iA program to perform complex number multiplication is as follows −Example Live Demo#include using namespace std; int main(){    int x1, ... Read More

C++ Program to Convert Binary Number to Octal and vice-versa

Ankith Reddy

Ankith Reddy

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

704 Views

In a computer system, the binary number is expressed in the binary numeral system while the octal number is in the octal numeral system. The binary number is in base 2 while the octal number is in base 8.Examples of binary numbers and their corresponding octal numbers are as follows ... Read More

Which one should I use? The datetime or timestamp data type in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:23:42

389 Views

Timestamp is a data type in MySQL and works for different time zone. It is also used for date and time purpose To understand the concept, we need to create a table.Creating a tablemysql> CREATE table TimeStampDemo -> ( -> MyDataTime timestamp -> ); Query OK, 0 rows affected (0.57 ... Read More

Work with white-space inside an element with CSS

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:21:25

135 Views

Use the white-space property to work with white-space inside an elementExampleLive Demo                    p.demo1 {             white-space: normal;          }          p.demo2 {             white-space: pre;          }                     Control white-space                This is demo text.          This is demo text.                      This is demo text.          This is demo text.          

What is ROW_NUMBER() in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:13:35

2K+ Views

Row_NUMBER() included from MySQL version 8.0. It is a type of window function. This can be used to assign a sequence number for rows. To understand, create a table with the help of CREATE pcommand −Creating a tablemysql> CREATE table rowNumberDemo -> ( -> FirstName varchar(100) -> ); Query OK, ... Read More

How can we use nested transactions allowed in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:11:48

292 Views

We can allow multiple transactions with the help of START command and SAVEPOINT. Let us create a table with the help of CREATE command.Creating a tablemysql> CREATE table transactionDemo -> ( -> id int auto_increment, -> primary key(id) -> ); Query OK, 0 rows affected (0.76 sec)After that, I will ... Read More

How to convert an MySQL database characterset and collation to UTF-8?

Ankith Reddy

Ankith Reddy

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

249 Views

Firstly, we will check which MySQL version is currently being used with the help of version() function −The query is as follows −mysql> SELECT version();The following is the output+-----------+ | version() | +-----------+ | 8.0.12 | +-----------+ 1 row in set (0.00 sec)As you can see in ... Read More

Advertisements