Here is the list of various categories of Simple C programs.
1. C Examples on Integers
C Programmming Language is been widely used in the field of Basic as well as Advanced Mathematics. The following section provides a list of C programs which deals with an aspect of Basic Mathematics “Integers”. The given set of Programs depict if the given Integer is odd or even, positive or negative, tests for their equality and divisibility, finds the sum of odd and even integers, swaps the values of integers and computes the sum of digits of the given integer. The programs also calculate the sum of digits in a given integer and calculates the sum of odd and even numbers.
2. C Examples on Number Conversion
Number Conversion is another area of Mathematics where C programming skills are widely used.The following section gives a list of C programs which convert a number of one type into a number of another type like Binary to Decimal, Binary to Octal and vice versa, Binary to Hexadecimal, Decimal to Octal and vice versa, Decimal to Hexadecimal, Roman number to a Decimal number. The section also covers C programs which perform conversion of Binary code of a number into its equivalent Gray code with and without recursion.
3. C Examples on Recursion
Recursion is the repeated application of a recursive definition or a procedure. C programming language supports recursion. Recursive functions are very helpful in solving mathematical problems. The following section displays a list of C Programs which illustrate the concept of recursion. These programs include finding the sum of the digits of a number, finding the reverse of a number, finding the summation of N numbers, finding if a number is prime or not, printing the binary equivalent of an integer and finding the product of the two given numbers.
4. C Examples on Special Numbers
Mathematics contains different kinds of numbers like Complex, Fibonacci, Armstrong and Perfect numbers. The following section provides a list of C numbers used to display these special numbers and also perform various operations on these numbers. These operations include reversing a number, checking if the number is a palindrome, addition and multiplication of binary numbers, other bitwise operations, checking if the given number is Armstrong or not, determining if the given number is perfect or not, generating and evaluating the first N Fibonacci numbers using command line arguments and calculating the sum of first 50 natural numbers using the for loop.
5. C Examples to illustrate Functions of a Computer
The following list of Programs pertain to the usage of Computer. It has C programs used to display the IP address of a system, to turn off the computer in Linux environment and to check for user authentication.
C Program to Illustrate how User Authentication is Done
C Program to Display the IP Address of the System
C Program to Shutdown or Turn Off the Computer in Linux
6. C Examples on day-to-day Activities
C programming skills can be applied to various activities in our day-to-day life. The following section is a list of C programs to display ATM transactions, to publish the inventory of items in a store, to determine if the given year is a leap year or not and extracting the last two digits of a given year.
C Program to Find if a given Year is a Leap Year
C Program to Extract Last two Digits of a given Year
C Program to Display the Inventory of Items in a Store
C Program to Display the ATM Transaction
7. C Examples on Union
A union is a special data type in C that enables you to store different data types in the same memory location. The following programs illustrate the concept of unions and find the size of a union. The section also covers C programs which display a very special behavior like displaying function without using the main function, printing a semicolon without using a semicolon, taking the height of a person as the input and categorizing it as Taller, Dwarf and Average, reading a grade and displaying its equivalent description.
8. C Examples to display Special Patterns
The following section covers some special C programs. It has programs to print diamond pattern, to print a statement without the usage of a semicolon and to produce its own source code as output.
C Program to Print Diamond Pattern
C Program to Print any Print Statement without using Semicolon
C Program to Display its own Source Code as its Output
9. C Examples to illustrate Call by Value and Call by Reference
The two important properties of C programming language are Pass by Value and Pass by Reference. Pass by Value means the called function’s parameter will be a copy of the caller’s passed argument. Pass by reference means the called function’s parameter will be the same as the caller’s passed argument. The C programs to demonstrate Call by Value and Call by Reference are given below.
C Program to Illustrate Pass by Reference
C Program to Illustrate Pass by Value
10. C programs to illustrate the use of Arguments
The following section provides a list of C programs which illustrate the use of arguments. Program to operate appropriately on the three numbers that are given as a input and program to print the program name along with all of its arguments are given below.
C Program to Input 3 Arguments and Operate Appropriately on the Numbers
C Program to Print the Program Name and All its Arguments