C Program to demonstrate Ternary condition.

C Program to demonstrate the Ternary conditional operator(?). Ternary operator is a short hand combination of the if-else statement. You can use the ternary operator in initialize lists. Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for personal and learning purposes. For permissions to use the* programs …

C Program to find Binomial Coefficients

C Program to find Binomial Integers without using recursion. Binomial coefficients are positive integers that are coefficient of any term in the expansion of (x + a) the number of combination’s of a specified size that can be drawn from a given set. There are many ways to compute the Binomial coefficients. Like, Recursive formula …

Palindrome Program in C – Check Number (Iterative, Function, Recursive)

A palindrome program in C checks whether a number reads the same forwards and backwards. Numbers like 121, 1331, and 12321 are palindromes; 12345 is not. The standard technique is to reverse the digits and compare with the original. This page covers three versions: a simple iterative solution, a clean function-based version, and a recursive …

C program to convert a Binary number into its equivalent Decimal, Octal and Hexadecimal numbers.

C Program to convert binary number into its equivalent Decimal, Octal, and Hexadecimal representations. In this program we convert a binary number to decimal. Then convert that decimal number to octal and Hexadecimal equivalent. The program implements various functions to do the job. binary_to_decimal : Convert given binary number to it’s decimal equivalent decimal_to_octal : Convert from …

C program to create a subsets using backtracking method.

C Program to find the subsets in the set. We use the backtracking method to solve this problem. Backtracking is the refinement method of Brute-Force method. Backtrack method means it finds the number of sub solutions and each may have number of sub divisions, and solution chosen for exactly one. Backtracking method is a recursive …

DFS Program in C – Depth First Search with Example

Depth First Search (DFS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking. Starting from a source node, it follows one path all the way to a dead end, then backtracks and tries the next unvisited neighbor. DFS uses a stack — either an explicit one or the …