
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

169 Views
In 3D geometry, planes are flat surfaces extending infinitely in space. When two planes intersect, they form a line, and the angle between them becomes an important geometric measure. In this article, we will learn how to calculate the angle between two planes in 3D space using a C program. The diagram below illustrates two planes intersecting in 3D space. These planes can be represented by the following equations: Equation P1: a1 * x + b1 * y + c1 * z + d1 = 0 P2: a2 * x + b2 * y + c2 * ... Read More

523 Views
Here we will see one interesting problem related to alphanumeric abbreviation of a given string. The string length is less than 10. We will print all alphanumeric abbreviations.The alphanumeric abbreviation is in the form of characters mixed with the digits. The value of that digit is number of characters that are missed. There may be any number of skipped substrings. No two substrings are adjacent to each other. Let us see the algorithm to get the idea.AlgorithmprintAbbreviation(s, index, max, str) −begin if index is same as max, then print str end if add s[index] ... Read More

313 Views
In this section we will see one interesting problem. Suppose one number is given. We have to increase this number by 1. This is extremely simple task. But here we will place the number as an array. each digit of that number is placed as an element of the array. If the number is 512, then it will be stored as {5, 1, 2}. And also we have to increase the number using recursive approach. Let us see the algorithm to get the clear idea.Algorithmincrement(arr, n, index) −Initially the default value of index is 0 begin if index < ... Read More

9K+ Views
What is Linear Search? Linear search is a sequential searching technique in which we start at one end of the list or array and look at each element until the target element is found. It is the simplest searching algorithm, with O(n) time complexity. Example Scenario let's see the following example scenario: Input: arr = {5, 4, 3, 8, 10}, K = 3; Output: 3 found at index 2; Input: arr = {1, 2, 3, 4, 5}, K = 7; Output: Not Found; How Linear Search Work? Following are the steps to search an element in array or ... Read More

412 Views
The program to find the minimum sum of factors of a number. The logic for solving this problem is, find all the set of factors and adding them. For every set of factors, we will do the same and then compare all of them. Then find all the minimum of these sums.Input: n=12 Output: 7ExplanationFirst find the factors of number n then sum them and try to minimize the sum. Following are different ways to factorize 12 and sum of factors in different ways.12 = 12 * 1 = 12 + 1 = 13 12 = 2 * 6 = ... Read More

9K+ Views
In this program, we are going to learn how to find the total number of lines available in a text file using C program?This program will open a file and read the file’s content character by character and finally return the total number of lines in the file. To count the number of lines we will check the available Newline () characters.Input: File "test.text" Hello friends, how are you? This is a sample file to get line numbers from the file. Output: Total number of lines are: 2ExplanationThis program will open a file and read the file’s content ... Read More

431 Views
Given two numbers dividend and divisor. The task is to write a program to find the quotient and remainder of these two numbers when the dividend is divided by the divisor.In division, we will see the relationship between the dividend, divisor, quotient, and remainder. The number which we divide is called the dividend. The number by which we divide is called the divisor. The result obtained is called the quotient. The number left over is called the remainder.55 ÷ 9 = 6 and 1 Dividend Divisor Quotient RemainderInput: Dividend = 6 Divisor = 2 Output: Quotient = 3, Remainder = ... Read More

4K+ Views
Square Matrix A is said to be skew-symmetric if aij=−aji for all i and j. In other words, we can say that matrix A is said to be skew-symmetric if transpose of matrix A is equal to negative of Matrix A i.e (AT=−A).Note that all the main diagonal elements in the skew-symmetric matrix are zero.lets take an example of a matrixA= |0 -5 4| |5 0 -1| |-4 1 0|It is skew-symmetric matrix because aij=−aji for all i and j. Example, a12 = -5 and a21=5 which means a12=−a21. Similarly, this condition holds true ... Read More

3K+ Views
Rat in a maze is also one popular problem that utilizes backtracking. IA maze is a 2D matrix in which some cells are blocked. One of the cells is the source cell, from where we have to start. And another one of them is the destination, where we have to reach. We have to find a path from the source to the destination without moving into any of the blocked cell. A picture of an unsolved maze is shown below.And this is its solution.To solve this puzzle, we first start with the source cell and move in a direction where ... Read More

456 Views
Given a number “n” as an input, this program is to find the total number of divisors of n is even or odd. An even number is an integer that is exactly divisible by 2. Example: 0, 8, -24An odd number is an integer that is not exactly divisible by 2. Example: 1, 7, -11, 15Input: 10 Output: EvenExplanationFind all the divisors of the n and then check if the total number of divisors are even or odd. To do this find all divisor and count the number and then divide this number by 2 to check if it is ... Read More