Tags C program

Tag: c program

C program of Bubble Sort Algorithm | C Code Champs

Bubble sorting is a simple sorting technique in sorting algorithm. In bubble sorting algorithm, we arrange the elements of the list by forming pairs of adjacent elements. It means we repeatedly step through the list which we want to sort, compare two items at a time and swap them if they are not in the right order. Another way...

C code for Divisibility Algorithm using DFA | C code Champs

C code for Divisibility Algorithm using DFA

Deterministic Finite Automaton (DFA) can be used to check whether a number “num” is divisible by “k” or not. If the number is not divisible, remainder can also be obtained using DFA.  Lets  see how to write C code for Divisibility Algorithm using DFA. We consider the binary representation of ‘num’ and build a DFA with k states. The DFA...

C Program to find total number of arguments passed

C supports variable numbers of arguments. But there is no language provided way for finding out total number of arguments passed. So lets write C Program to find total number of arguments passed. User has to handle this in one of the following ways: 1) By passing first argument as count of arguments. 2) By passing last argument as NULL (or...

C program to find logarithm of number | C Code Champs

C program to find logarithm of number

C program or source code that calculates and returns logarithm  . For example, if n = 64, then your function should return 6, and if n = 129, then your function should return 7. Let us see how to use C program to find logarithm of number. Following is a solution using recursion for C program to find logarithm of ...