## C Program to Find the closest pair from two sorted arrays

Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each… Read More »

- Interesting Facts in C Programming | Set 2
- time.h header file in C with Examples
- TCP Client-Server Program to Check if a Given String is Palindrome
- Lex program to implement a simple Calculator
- What is a Pointer to a Null pointer
- Lex program to search a word in a file
- C program to store Student records as Structures and Sort them by Age or ID
- Lex program to find the Length of a String
- How to Append a Character to a String in C
- time.h localtime() function in C with Examples
- Lex program for Decimal to Hexadecimal Conversion
- Lex program to check perfect numbers
- Lex program to check whether input number is odd or even
- Lex code to replace a word with another word in a file
- C program to print the length of a String using %n format specifier

Given two sorted arrays and a number x, find the pair whose sum is closest to x and the pair has an element from each… Read More »

There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs… Read More »

We can use binary search to reduce the number of comparisons in normal insertion sort. Binary Insertion Sort find use binary search to find the… Read More »

Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] and its permutations (or… Read More »

Given a positive integer N, count all possible distinct binary strings of length N such that there are no consecutive 1’s. Examples: Input: N =… Read More »

Area of a circle can simply be evaluated using following formula. Area = pi * r2 where r is radius of circle filter_none edit close… Read More »

Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing… Read More »

Factorial of a non-negative integer is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More »

Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire… Read More »

Given an array, find the largest element in it. Input : arr[] = {10, 20, 4} Output : 20 Input : arr[] = {20, 10,… Read More »

Given an integer n, write a function that returns count of trailing zeroes in n!. Examples : Input: n = 5 Output: 1 Factorial of… Read More »

Catalan numbers are a sequence of natural numbers that occurs in many interesting counting problems like following. 1) Count the number of expressions containing n… Read More »

Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. C/C++ filter_none edit close… Read More »

Given a singly linked list, sort it using bubble sort. Input : 10->30->20->5 Output : 5->10->20->30 Input : 20->4->3 Output : 3->4->20 filter_none edit close… Read More »

Given two numbers, write a C program to swap the given numbers. Input : x = 10, y = 20; Output : x = 20,… Read More »