C language
A journey to live & code
Creator OF
C
Dennis Ritchie
What is process? (in general)
A set of steps that are performed to
complete or achieve intended goal
Example.
Process of making TEA
What is Function? (in general)
A function is something that makes the process
Reusable , fast and Easy
Example.
->Machine To make Tea
->Machine will perform all the steps or process to
make TEA. (As many time you want , easy to use it
any where)
-> just put water, milk , tea leaf , sugar and power it.
Tea leaf
Water
Sugar
Milk
process
Tea
Machine to Make Tea ( function )
Electricity
{
Tea leaf
Water
Sugar
Parameter of
Milk
function
Machine to Make
Tea ( function )
process
{ Output
Or
{
Definition or process
of function
Tea
Return statement
TEA machine_name ( liquid milk , liquid water , solid sugar , solid tea_leaf)
{
Return-Type
What will function return
Step 1) Boil ( water );
Step 2) Add ( tea-leaf);
Step3)
Data-Type
if(boiled ){ Name Of parameter
Add( milk );
Function Add( sugar);
To Boil();
Add and boil
}else{
Boil();
}
Function returning Tea
Step 4) return tea ;
As its return type is TEA
}
Variable , Variable name , Data type
Here, Bag name is variable name as it Here Data-type is FRUIT . Bag
bag is variable as it can can be use to identify fruits bag can only allow fruits in it.
store data(fruit) from all other bags. Because its data type is FRUIT
Only fruit
Fruit bag