Arjun Thakur has Published 1109 Articles

Clearing input buffer in C/C++

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:36:21

22K+ Views

The function fflush(stdin) is used to flush or clear the output buffer of the stream. When it is used after the scanf(), it flushes the input buffer also. It returns zero if successful, otherwise returns EOF and feof error indicator is set.Here is the syntax of fflush(stdin) to clear the ... Read More

isspace() function in C++

Arjun Thakur

Arjun Thakur

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

3K+ Views

The isspace() function is a predefined function in ctype.h. It specifies whether the argument is a whitespace character or not. Some of the whitespace characters are space, horizontal tab, vertical tab etc.A program that implements isspace() function by counting the number of spaces in a string is given as follows ... Read More

iscntrl() function in C++

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:22:26

87 Views

The iscntrl() function in C++ checks if a character is a control character or not. This function is defined in ctype.h.The syntax for iscntrl() function is given as follows −int iscntrl ( int ch );Here, ch is the character that needs to be checked.A program that demonstrates iscntrl() function by ... Read More

C++ Program to Implement Circular Queue

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:19:29

24K+ 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.A circular queue is a type of queue in which the last position is connected to the first position to make a ... Read More

C++ Program to Sort Elements in Lexicographical Order (Dictionary Order)

Arjun Thakur

Arjun Thakur

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

1K+ Views

Lexicographical order denotes the way the words are ordered in a list, based on alphabetical order according to their alphabets. For example −List of words: Harry Adam Sam Lexicographical order of words: Adam Harry SamA program to sort elements in lexicographical order is as follows −Example Live Demo#include using ... Read More

C++ Program to Perform Addition Operation Using Bitwise Operators

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 09:05:32

1K+ Views

Bitwise operators are used to perform bitwise operations. That implies the manipulation of bits. Some of the bitwise operators are bitwise AND, bitwise OR, bitwise XOR etc.A program to perform addition operation using bitwise operators is given below −Example Live Demo#include using namespace std; int main() {    int num1, num2, ... Read More

C++ Program to Solve any Linear Equation in One Variable

Arjun Thakur

Arjun Thakur

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

5K+ Views

Any linear equation in one variable has the form aX + b = cX + d. Here the value of X is to be found, when the values of a, b, c, d are given.A program to solve a linear equation in one variable is as follows −Example Live Demo#include using ... Read More

C++ Program to Perform LU Decomposition of any Matrix

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 08:41:22

4K+ Views

The LU decomposition of a matrix produces a matrix as a product of its lower triangular matrix and upper triangular matrix. The LU in LU Decomposition of a matrix stands for Lower Upper.An example of LU Decomposition of a matrix is given below −Given matrix is: 1 1 0 2 ... Read More

Set how auto-placed items are inserted in the CSS grid

Arjun Thakur

Arjun Thakur

Updated on 25-Jun-2020 08:38:45

102 Views

Use the grid-auto-flow property to set how auto-placed items are inserted in grid. You can try to run the following code to implement the grid-auto-flow propertyExampleLive Demo                    .container {             display: grid;       ... Read More

C++ Program to Implement Variable Length Array

Arjun Thakur

Arjun Thakur

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

6K+ Views

Variable length arrays can have a size as required by the user i.e they can have a variable size.A program to implement variable length arrays in C++ is given as follows −Example Live Demo#include #include using namespace std; int main() {    int *array, size;    cout

Advertisements