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 Program to Demonstrate #if, #else & #endif preprocessors.

C Program to demonstrate the Preprocessor directives like #if, #else, #define, #endif. C Preprocessors are not the program statements, they are executed before the actual compilation of the code. C Preprocessors substitute the code where they called, i.e they replace the code as they defined. #if, #else are the conditional directives. Here at the compile …

C Program to check the given number is perfect or not.

C Program to check the given number is perfect or not?.  Perfect number is a positive integer that is equal to the sum of its proper positive divisors. example 6, divisor of 6 are 1, 2,3. Sum of divisors is 1+2+3=6. Read more about C Programming Language . /************************************************************ You can use all the programs …

C Program to print Floyd’s triangle

Floyd’s triangle is the right angled triangular array of natural numbers. Here we used the nested For loop to print the Floyd’s triangle. 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 purposes,* contact [email protected]* …

C Program to calculate the total execution time of a program.

C Program to calculate the total execution time of a program. Here we used the “time.h” preprocessor. In this program we used the clock_t variables start and end , They starts the time counter and ends the counter. Execution time of a program is useful to calculate the efficiency of the program. Read more about …

C Program to generate random numbers.

C Program to generate random numbers. Random Numbers are numbers which are produced by a process and its outcome is unpredictable.The function srand() is used to seed the random sequence. The rand() function shall compute a sequence of pseudo-random integers in the range [0, {RAND_MAX}] with a period of at least 2^32. Read more about …

C Program to show Sleep() function example.

C Program to show Sleep() function example. sleep() function stops the execution of the program, wherever its invoked or called. It takes the arguments in microseconds. In Windows we use Sleep() function i,e ‘S’, and for other systems it is sleep() function. /*********************************************************** * You can use all the programs on www.c-program-example.com * for personal …

C Program to perform complex numbers operations using structure.

C Program to perform complex numbers operations using structure. Complex numbers are numbers which contains two parts, real part and imaginary part. Complex numbers are written as a+ib, a is the real part and b is the imaginary part. We used the structure in C to define the real part and imaginary part of the …

C Program to convert a Roman numeral to its decimal equivalent.

C Program to convert a Roman numeral to its decimal equivalent. Roman numbers are the oldest number system used in ancient Rome. They use the combination of letters from Latin alphabet to represent the system. We used the if-else and for statements to solve this problem. Read more about C Programming Language . /************************************************************ You …

C program to find the 2’s complement of a binary number.

C Program to calculate the 2’s complement of a binary number. 2’s complement of a number is obtained by scanning it from right to left and complementing all the bits after the first appearance of a 1. Thus 2’s complement of 11100 is 00100. Read more about C Programming Language . /************************************************************ You can use …