# C Programming Code Examples

## C > For Loops and While Loops Code Examples

### C program to find ones complement of a binary number

Convert Binary to Hexadecimal in the C++ -
To convert binary to hexadecimal in C++, you have to ask to the user to "enter any number" in binary to convert it into hexadecimal, then display the equivalent hexadecimal value on

C++ Code Find Largest of Three Numbers -
To find the largest number among the three numbers in C++, enter three numbers, now checking which one is the "largest number". After finding the largest number, we display

Use Infinite for Loop in C++ Programming -
A Loop is said to be infinite when it executes repeatedly & 'never stops'. It usually happens by mistake. When you set the condition in for loop in such a way that it never return false, it

C Programs Calculates Standard Deviation -
C Language calculateSD() function calculates the Standard Deviation. The array containing 10 elements is passed to the function and this function calculates the Standard Deviation &

C Program setlocale Set Local Information -
C programming code to set local information. Refers to all localization categories. Affects the operation of the strcoll() function. Alters the way the character functions work and...

C Finds Sum of Even Numbers from 1 to N -
C Program to input upper limit to find sum of even number. Store it in some variable say N. Initialize another variable to store sum with 0 say sum = 0. To find sum of even numbers we

Program to Display Odd numbers without -
C Program to print odd numbers from 1 to n without if statement. The above approach is not optimal approach to print odd numbers. Observe the above program for a while. You

Program to Pick and Print a random value -
Picks a random value withing range low-high. Value returned seeds the rand() function. Print version information and exit. First seed the random function. Add line, to the array...