
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
Found 1339 Articles for C

734 Views
A stack is a data structure that stores elements. There are two operations on the stack. push that adds a new element to the stack. pop that removes an element from the stack.The stack can grow upward and downward according to the nature of the program that uses it. The program to find the direction of the growth of stack in a program.AlgorithmStep 1: Create a local variable in the main function. Step 2: Create a function that with a local variable. Step 3: Call the function from the main function. And then compare the local variables of in both ... Read More

9K+ Views
In the C programming language, the programmer can excess the files and read and write content in them.A file is a simple memory block that can store information, here we are concerned with text only.In this program, we will compare two files and report mismatches that occur. These files are almost identical but may have some characters that are different. Also, the program will return the line and position of the file at which the first mismatch occurs.AlgorithmStep 1: Open both the file with pointer at the starting. Step 2: Fetch data from file as characters one by one. Step ... Read More

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

582 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

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

744 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