# C Programming Code Examples

## C > For Loops and While Loops Code Examples

Page 1 Page 2 Page 3

Page 1 Page 2 Page 3

Learn About Structure of a C++ Program

A C++ program starts its execution from this method "main". Wherever this main method is, the main method will be executed first. '()' is used at the end as main is a method. Main

Display the contents of structure elements

C Program code to use structure within union & display the contents of structure elements. Problem statement: Create one structure and declare it inside union. Then accept values for

C++ Code Solves Tower of Hanoi Problem

In The C++ program, displays the solution to the Tower of Hanoi problem using the base-2 representation of the move number with the following rules:- There is one binary digit (bit)

C Program to print Even numbers without

The above approach to list Even Numbers is not optimal. It unnecessarily iterates for odd numbers which is a performance issue and to overcome this start the loop with first even...

This C Program code finds the intersection & union of 2 Linked lists. Intersection is a set of elements that are common in both lists while union is a set of all Unique Elements in both...

Program for Beginners: Area of Rectangle

A plane figure with 4 sides & 4 right angles & having Equal Opposite sides. Adjucent sides makes an Angle of 90 degree. Just compute the area of a Rectangle if you know its length

C++ Language Simple Quick Sort Program

"Quicksort" is an Efficient Sorting Algorithm, serving as systematic method for placing the elements of an array in order. 'Quicksort' can operate 'in-place' on an array, requiring small

Check Whether the Number is Armstrong

This C Program code checks whether a given number is armstrong number. An Armstrong number is an n-digit base b number such that the Sum of its Digits raised to the Power N is