- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7347 Articles for C++
1K+ Views
Numerical implementation of a decimal number is a float point number. In C++ programming language the size of a float is 32 bits. And there are some floating point manipulation functions that work on floating-point numbers. Here we have introduced some of the floating-point manipulation functions.fmod()The fmod() function operating on floats will return the remainder of the division of the passed arguments of the method.Example Live Demo#include #include using namespace std; int main() { float a, b, rem; a = 23.4; b = 4.1; rem = fmod(a,b); cout
2K+ Views
A function is a block of code that is defined to perform a specific piece of work in a program. It is used to ease the work of the programmer by defining a commonly occurring piece of code so that it can be reused when required.The address is the memory location where the entity is stored. Every block of code in the program has its own memory location in the program. Which means like any variable or object methods and functions also have memory address.To get the memory address of a function you need to use the pointer of the ... Read More
23K+ Views
To understand this concept better let's first brush up all the basic contents that are required.linked list is a data structure that stores each element as an object in a node of the list. every note contains two parts data han and links to the next node.Polynomial is a mathematical expression that consists of variables and coefficients. for example x^2 - 4x + 7In the Polynomial linked list, the coefficients and exponents of the polynomial are defined as the data node of the list.For adding two polynomials that are stored as a linked list. We need to add the coefficients ... Read More
145 Views
Array − An array is a container of elements of the same data type, whose elements are 0 indexed.In this problem, we will use an array of integers. And check if all the elements are greater than the given number or not. Here we will check if all elements of the array are greater than or equal to a given number k. If not then we will add two minimum elements of the array and treat this sum as a single element. And then again check for the same condition for the new array. If the condition comes out to ... Read More
686 Views
In programming, the ++ operator is the increment operator that increases the value of the operand by 1. We can add two numbers using this operator by adding 1 to the number a, b number of times.Example,Input: a = 31 , b = 4 Output: 35Explanation − adding 1 to 31 four times, sums up to 31 +1+1+1+1 = 35.AlgorithmInput: two integers a and b. Step 1: loop from 0 to b and follow step 2. Step 2: add 1 to b. Step 3: print the value of a.Example Live Demo#include using namespace std; int main(){ int x = 324 , y= 76; cout
5K+ Views
Here are 10 tricky programs that will test your programming basics.1. Program to print “ ” in C++In C++ programming language, we use quotes to denote the start and end of the text is to be printed. So, printing quotes “ needs a special escape sequence. So, we will use the \” to print quotes in c++.Example Live Demo#include using namespace std; int main() { cout
5K+ Views
A greedy algorithm is an algorithm used to find an optimal solution for the given problem. greedy algorithm works by finding locally optimal solutions ( optimal solution for a part of the problem) of each part so show the Global optimal solution could be found.In this problem, we will use a greedy algorithm to find the minimum number of coins/ notes that could makeup to the given sum. For this we will take under consideration all the valid coins or notes i.e. denominations of { 1, 2, 5, 10, 20, 50 , 100, 200 , 500 ,2000 }. And we ... Read More
183 Views
C++ Programming languageA successor of the c programming language that has introduced the concept of classes and objects. It encapsulates features of c and high-level language hence it can be treated as an intermediate-level language. When it was created it was thought of as a C that has classes because of its similarities with C.C# Programming LanguageC# (also known as C sharp) is a general-purpose programming language that was developed by Microsoft to run on .net framework for developing applications for its operating system. It is an object-oriented programming language with features like object-oriented, statically typed, decorative, multiparadigm programming language.Both ... Read More
22K+ Views
In C++ stream refers to the stream of characters that are transferred between the program thread and i/o.Stream classes in C++ are used to input and output operations on files and io devices. These classes have specific features and to handle input and output of the program.The iostream.h library holds all the stream classes in the C++ programming language.Let's see the hierarchy and learn about them, Now, let’s learn about the classes of the iostream library.ios class − This class is the base class for all stream classes. The streams can be input or output streams. This class defines members that ... Read More
435 Views
A file is a memory location that stores word streams. In a file, there are various words. In this program, we will find all unique words from the file and print them.A unique word means the number of occurrences of the word is one in the file.For example, Tutorials point is best for programming tutorials.Here, the word tutorial occurs more than once, hence it is not unique. Rest all words are unique.AlgorithmTo check for unique words in the given file. Using iterator with two variables : data and occurence. Input : File Step 1 : Read each line from the ... Read More