How to Re-Indent C Code Using Notepad++

Indentation is very important for readability and manageability of code, especially, if the size of code base fairly big. Badly indented code is very difficult to understand or maintain. Good developers always maintain proper indentation but many times we get codes from internet or other sources which are not properly indented, many times they are … Continue reading “How to Re-Indent C Code Using Notepad++”

C Program to Compute LCM of Multiple Integers

In mathematics, Least Common Multiple or Lowest Common Multiple (LCM) of two integers is the lowest possible positive integer that is divisible by both the integers. We’ll first see how to write C program to compute LCM of two integers. Then we’ll extend that logic for multiple integers. APPROACH 1: LCM Using GCD We can … Continue reading “C Program to Compute LCM of Multiple Integers”

C Program to Find GCD Using Recursion

In mathematics, Greatest Common Divisor (GCD), also known as Highest Common Factor (HCF), of two or more integers is the largest possible integer that divides all the numbers without any reminder. To find out GCD at least one of the integers has to be no-zero. Here we’ll see how to white a recursive function to find … Continue reading “C Program to Find GCD Using Recursion”

Implement Binary Search in C

Binary search is an efficient searching technique that is used to search a key in a sorted array. In every iteration, searching scope is reduced to half. That’s why it is called Binary Search or Half Interval search. Binary Search Algorithm If the middle element of the sub-array is equal to the key, then the … Continue reading “Implement Binary Search in C”

Where to Use Different Types of Loops (for, while, do-while) in C

Loops are very fundamental programming language constructs that allow us to execute a block of code multiple times. In C programming language, there are three types of loops: for, while and do-while. Here we will discuss on the syntax of every loop and where to use them. Though we have three types of loops, any one … Continue reading “Where to Use Different Types of Loops (for, while, do-while) in C”

0
0
0
0
0
0