Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C Articles - Page 72 of 134
1K+ Views
In Programing when a program malfunction and runs unusually in the terminal compiler the programmer has the power to explicitly stop the program from running. For explicitly stopping the program, the user must know the right keyboard shortcut that is needed to be pressed.To terminate the execution of a block of code, there are two types of keyboard shortcuts used.Ctrl+c − It is used to stop the execution of the program, it take a bit of time to complete the i/o operations and then suspends the execution. It sends a SIGINT signal to the process which gets terminated. In some ... Read More
2K+ Views
An algorithm is a set of instructions that are performed in order to solve the given problem. Here, we will discuss the reversal algorithm for array rotation and create a program for a reversal algorithm.Now, let's get to some terms that we need to know to solve this problem −Array − A container of elements of the same data type. The size (number of elements) of the array is fixed at the time of the declaration of the array.Array rotation − Rotating an array is changing the order of the elements of the array. Increasing the index of the element ... Read More
13K+ Views
A circle is a closed figure. All the points of the circle are equidistant from a point that lies inside in circle. The point at the center is known as the center of the circle. The distance of points from the center is known as the radius.The area is the quantitative representation of the span of the dimensions of a closed figure.The area of circle is the area enclosed inside the dimensions of a circle.The formula for calculating the area of a circle, Area = π*r*rTo calculate the area we are given the radius of the circle as input and ... Read More
595 Views
Problem statement − A program to find the number of ways in which a train will stop in r stations out of n stations so that no two stopping stations are consecutive.Problem ExplanationThis program will calculate the number of ways i.e. permutations in which the train will stop. Here, the train will travel from point X to Y. Between these points, there are n stations. The train will stop on r stations of these n stations given the conditions that while stopping on r stations the train should not stop in two consecutive stations.This permutation can be found using the ... Read More
3K+ 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
759 Views
In this problem, we are given two unsigned numbers, and we need to add them using bits in C++. Bits are binary digits that can be either 0 or 1. Unsigned numbers are positive numbers represented by these bits. To add two unsigned numbers, we add their bits one by one using binary addition rules. Binary addition works like decimal addition, but with simpler rules: 1 + 0 = 1 0 + 1 = 1 0 + 0 = 0 1 + 1 ... Read More
2K+ Views
A number represented by the array is stored in such a form that each digit of the number is represented by an element of the array. For example, Number 234 in array is {2, 3, 4}.To add to such numbers we will first add number at the least significant digit and if the sum is greater than 10 propagate the carry. After this, we will go for the next consecutive digits of the array doing the same procedure and finding the sum.Let’s take an example to add two numbers −a = {2, 9, 6} b = {6, 3, 8} Output: ... Read More
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
6K+ 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
2K+ Views
Error or exception is something that refers to the interruption of code execution due to which the expected outcome could not be attained to the end-user.On the basis of the event when an error is generated or identified we can classify them as Compile time error and runtime error.The following are the important differences between Compile Time Errors and Runtime Errors.Sr. No.KeyCompile Time ErrorsRuntime Errors1ReferenceCompile-time errors are generally referred to the error corresponding to syntax or semantics.Runtime errors on the other hand refer to the error encountered during the execution of code at runtime.2DetectionCompile-time errors get detected by compiler at ... Read More