Practice "c programming" examples

HOME , Page#1 , Page#2 , Page#3 , Page#4 , Page#5 , Page#6 , Page#7 , Page#8 , Page#9 , Page#10 ,

Page#11 , Page#12 , Page#13 , Page#14 , Page#15 , Page#16 , Page#17 , Page#18 , Page#19 , Page#20
01 c syntax
C Syntax : This is an example of c programming syntax and this will be your first programe in c language.

Display "Hello C World" using c programming language.

Before discussing any specific features of C, we shall look at some sample C programs and analyze and understand how they work. Click link/Hyperlink at right column.
C programming Source Code See in:
C++
C# Console
Python
Java
OOP C++
OOP Java
02 calculator
Using this source code, you will be capable to make a calculator as like real life calculator. Here you will learn Arithmetic Operator, Switch and Goto in c programming language

Write a C program for performing as calculator which allows all Arithmetic Operators with operands from terminal.

Few Input and Output sample are given below:
Recommended: Study Char/Char Array in C/C++           
Sample Input: 1 + 4
            Sample Output: 5

            Sample Input: 8 % 2
            Sample Output: 0

            Sample Input: 6 / 2
            Sample Output: 3

            Sample Input: 5 / 2
            Sample Output: 2.5
C programming Source Code See in :
C++
C# Console
Python
Java
OOP C++
OOP Java
03 simple interest
This source code will find or calculate simple interest based on the formula given by user. It is an example of formula calculation in banking enterprise. This kind of source code is widely used in Banking-cum-Accounting software. Here, you will get knowledge about "Arithmetic in c" and "Float Data Type" in c programming language.

Write a C program to find the Simple Interest. Take input for Principle Amount, Rate of Interest and Time from terminal.

Simple Interest is the money paid by the borrower to the lender, based on the Principle Amount, Interest Rate and the Time Period.
Simple Interest is calculated by, SI= P * T * R / 100 formula.
Where, P is the Principle Amount.
T is the Time Period.
R is the Interest Rate.

Definition of 'Simple Interest' from WEB

A quick method of calculating the interest charge on a loan. Simple interest is determined by multiplying the interest rate by the principal by the number of periods.
Simple Interest = P x I x N
C programming Source Code See in:
C++
C# Console
Python
Java
OOP C++
OOP Java
04 integer grades
This is an example of grading system  like in  school, college and university. This source code will be your supporing document in future while you will be responsible to complete an educational software. Here, you will get idea about "Arithmetic" and "If" also.

Find the highest (maximum) and lowest (minimum) grades in an array of 25 integer/float grades.

Print the array and print the highest and lowest grades, labeled appropriately. Try to enter all kind of integer/float grades in your array.
Hits of integer grades:

A+ is a Letter Grade.
A is  a Letter Grade.
4 is an Integer Grade.
3.75 is an Integer Grade.
So we may assume that 'A+' = 4, A = 3.75 etc.
C programming Source Code See in:
C++
C# Console
Python
Java
OOP C++
OOP Java
05 array programming
Using this source code you will be an expert in array programming in c language. This is an ideal example of array manipulation. Without array programming , it will be difficult for yo to handle dynamic programming in c language. Here, you will get details idea regarding Array, For and If statements.

Array programming

Write a C Program to fill up an Integer Array. The length of the array must take from the terminal.

After fill up the array do the following operations.
i)                    Print the array with label formatting.
ii)                   Count the number of values inside the array.
iii)                 Count the number of odd values.
iv)                 Count the number of even values.
v)                  Sum all the odd values.
vi)                 Sum all the even values.
vii)               Calculate the average.
viii)              Find the largest value.
ix)                 Find the smallest value.
C programming Source Code See in:
C++
C# Console
Python
Java
OOP C++
OOP Java
06 comparison operator
This is a heart of programming language. Logical statements make programming language inteligent. Moreover, this is a best example of; how to use comparison operators in c programming language and you will get examples of "Comparison Operator" and "If statements".

Comparison Operator

Write and run a program that reads the users age and then prints "You are a Child" if the age < 18, " You are an adult." if 18<=age<65, and "You are a senior citizen." if age >=65.

C programming Source Code See in:
C++
C# Console
Python
Java
OOP C++
OOP Java
07 conditional operator
This is an example of Integer Number manipulation with some conditions. Here, you will learn the use of "if statements" Moreover, it will provide you the knowledge of decession making using c programming language.

Conditional Expression

Write and run a program that reads two integers and then uses the conditional expression operator to print either "Multiple" or "Not" according to whether one of the integers is a multiple of the other.

C programming Source Code See in:
C++
C# Console
Python
Java
OOP C++
OOP Java