
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 1354 Articles for C

3K+ Views
Introduction The corrupt stack problem is a common issue that programmers encounter while developing software in C and C++ programming languages. This problem can arise due to a wide range of reasons and can cause severe problems in functioning of program. In this article, we will explore corrupt stack problem in detail and look at some examples of how it occurs. What is a Stack in C and C++? Before we discuss corrupt stack problem, we need to understand what a stack is. In C and C++, a stack is a data structure that allows data to be stored and ... Read More

9K+ Views
What is CHECKSUM? In computing, a checksum is a small-sized data created from a larger data set using an algorithm, with the intention that any changes made to the larger data set will result in a different checksum. Checksums are commonly used to verify the integrity of data that has been transmitted or stored, as errors or modifications in the data can cause the checksum to change. They can also be used to verify the authenticity of the data, as the checksum is often generated using a secret key known only to the sender and receiver. Why we use CHECKSUM? ... Read More

2K+ Views
Many developers will indeed agree that comparing C Programming and PHP is unfair because they differ in web development. PHP is by far the most famous serverside scripting language. JavaScript works with things on the client end without ever returning to the server, while PHP manages things on the application server. PHP is based on the C programming language, thus everyone with a basic understanding of C will find it easy to learn PHP. What is PHP? PHP is a general−purpose programming language that is primarily utilized in the development of websites. It was developed in 1994 by DanishCanadian programmer ... Read More

1K+ Views
fopen() method in C is used to open the specified file.Let’s take an example to understand the problemSyntaxFILE *fopen(filename, mode)The following are valid modes of opening a file using fopen(): ‘r’, ‘w’, ‘a’, ‘r+’, ‘w+’, ‘a+’. For details visit visit C library function - fopen()fopen() for an existing file in write modeIf the file to be opened does not exist in the current directory then a new empty file with write mode is created.If the file to be opened exists in the current directory and is open using ‘w’ / ‘w+’, the contents will be deleted before writing.ExampleProgram to illustrate ... Read More

651 Views
We will understand how C and C++ behave differently in case we re-declare a global variable without initializing, redeclaring global variables with initialization, redeclaring global variables and initializing them twice. Also, we will repeat above combinations with local variables.1. A) C program : Redeclaring Global variables with no initialization#include int var; int var; int main(){ printf("Var = %d",var); return 0; }OutputVar = 0B) C++ program : Redeclaring Global variables with no initialization#include using namespace std; int var; int var; int main(){ cout

8K+ Views
Bubble Sort is one of the simplest sorting algorithms used to sort data by comparing the adjacent elements. All the elements are compared in phases. The first phase places the largest value at the end, the second phase places the second largest element at the second last position and so on till the complete list is sorted.Bubble Sort Algorithmint arr[5]= { 5, 4, 2, 1, 3 };int i, j ;Traverse from index i=0 to iarr[j] swap arr[i] with arr[j]EndRecursive Bubble SortIf array length is 1 then returnTraverse array once and fix largest element at the endRecursively perform step 2 for ... Read More

294 Views
Suppose we are in charge of building a library system that monitors and queries various operations at the library. We are now asked to implement three different commands that perform the following −By using command 1, we can record the insertion of a book with y pages at shelf x.By using command 2, we can print the page number of the y-th book at shelf x.By using command 3, we can print the number of books on shelf x.The commands are given to us as a 2D array in this format {command type, x, y}. If there is no y ... Read More

1K+ Views
Suppose we are given two integers k and n. Our task is to perform three operations; bitwise AND, bitwise OR, and bitwise XOR between all pairs of numbers up to range n. We return the maximum value of all three operations between any two pairs of numbers that is less than the given value k.So, if the input is like n = 5, k = 5, then the output will be 4 3 4.The greatest value of AND, OR, and XOR operations between all pairs of numbers that are less than 5 are 4, 3, and 4 respectively. We can ... Read More

765 Views
Suppose we have an array of different triangles where triangles[i] = [ai, bi, ci] these are the sides of ith triangle. We shall have to sort the triangles based on their area. The area of a triangle by using sides is: square root of p*(p-a)*(p-b)*(p-c) where p = (a+b+c)/2.So, if the input is like (7, 24, 25), (5, 12, 13), (3, 4, 5), then the output will be (3, 4, 5), (5, 12, 13), (7, 24, 25)To solve this, we will follow these steps −Define triangle object with sides a, b and cDefine a function square(), this will take Triangle ... Read More

2K+ Views
Suppose we want to make some functions that can take multiple arguments, there are no fixed number of arguments. We want to make three functions sum(), max() and min(), they can calculate sum of the numbers, maximum of numbers and minimum of given numbers respectively. Each of these functions will take number of arguments count as their first argument. To define this type of functions we need to use ellipsis (...) three dots into the function argument. To use it we shall have to include stdarg.h header file. This type of function is called variadict functions. To access variable arguments ... Read More