C Program to generate Graph using grphics.h

C Program to Generate the graph sheet using the grphics.h library. To use graphics.h, we have to install the drivers in to the the system by using the initgraph() function. Here  we derive the graph of input sizes verses time taken for input sizes. x axis represents inputs(0,10000,20000,—-), y axis rep time(0,0.05,0.1,0.15—). Read more about …

Factorial Program in C – Iterative and Recursive with Output

The factorial program in C is one of the most common exercises for learning recursion and loops. The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 to n. By definition, 0! = 1. This page covers two approaches — iterative and recursive — with compile-verified code, …

C Program to demonstrate the ‘fgets’ function.

Program to demonstrate the ‘fgets’ function. The program will count the number of lines in a file. This is a function of the UNIX command ‘wc’. 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 for commercial …

Combinations and Permutations in C (nCr and nPr)

Combinations and permutations in C are computed using two related formulas. A combination C(n, r) counts the number of ways to choose r items from n items where order does not matter. A permutation P(n, r) counts the number of ways to arrange r items chosen from n items where order matters. C(n, r) = …

C Program to check the given number is Armstrong or not?

C Program to check the given number is Armstrong number or not?. Armstrong number is a number that is the sum of its own digits each raised to the power of the number of digits. Example: 153 = 1^3 + 5^3 + 3^3. Read more about C Programming Language . /************************************************************ You can use all …

C Preprocessor Directives – #define, #if, #ifdef, #ifndef with Examples

C preprocessor directives are instructions that run before compilation. The preprocessor reads your source file, processes every line that starts with #, and hands the result to the compiler. Understanding them well means smaller code, safer constants, conditional compilation for different platforms, and header files that include safely more than once. Object-Like Macros — #define …