# C Programming Code Examples

## C > Arrays and Matrices Code Examples

### Program to Accept a Matrix of Order MxN & Interchange the Diagonals

C++ Samples for Constructor Overloading -
"Constructor" is automatically called when an object create. It is "special member function" of the class. Variable declaration, constructor without argument, and which constructor has

C Earth years to other Planets Conversions -
Display conversions in C. Equivalent mercury years. Equivalent venus years. Equivalent mars years. Equivalent jupiter years. Saturn years. Uranus years, Neptune years, Pluto...

Calculate Area and Perimeter of Rectangle -
To calculate "area and perimeter" of a square and rectangle in C++ Programming, you have to ask to the user to enter length and breadth of the rectangle and side length of the square

Code find first & last digit of any number -
C program to input a number from user and find first and last digit of number using loop. Before I explain logic to find first digit, let us first learn to find last digit of a number. Find

Convert Decimal number to Octal Number -
Accept the given decimal number. If number is less than 8 the octal number is the same. If the number > 7 then Divide the number with 8. Write down the remainder. Do steps 3 and

C Language Codes Sorts the List of Strings -
C program which will accept 'multiple strings' from the user and will sort them in ascending order. Checking each successive strings using strcmp() function. If string is greater than the

Switch Statement Calculates Grade Points -
A simple c++ program which shows using of switch statement in c++. C++ Program which takes input a grade and display Grade Points Average GPA. Program takes inputs A,a, B,b,

Find the Largest Two Numbers in an Array -
C Program code calculates the largest of two numbers in a given Array. First it accepts an array, then compares the elements and finds which is the largest two element in a given...