C Programming
C Programming
GROUP 1
Janine Rose Callangan
Steve Nash Gumabay
Ashley Keith Alvarez
Klayre Sopheeya Collado
Acee Angelique Labang
Robert Dindo Balagan
Neil Nathaniel Imperial
prayer
Ashley Keith Alvarez
What to learn?
C Programming Functions
C User-defined Functions
Types of User-defined
Functions in C Programming
C Programming Functions
A function is a group of
statements that together
perform a task.
C functions are basic building
blocks of program.
A large program in c can be
divided to many subprogram
C Programming Functions
The subprogram possess a self
contain components and have
well define purpose
The subprogram is called a
function
Basically a job of a function is to
do something
C program contain at least one
function which is main()
C Programming Functions
The checkPrimeNumber() function takes input from the user, checks whether it is a
prime number or not, and displays it on the screen.
The empty parentheses in checkPrimeNumber(); inside the main() function indicates
that no argument is passed to the function.
The return type of the function is void. Hence, no value is returned from the function.
example 1: no argument passed and no return value
Example 2: No Arguments Passed But Returns a Value
Here, the getInteger() function takes input from the user and returns it. The code to
check whether a number is prime or not is inside the main() function.
Example 2: No Arguments Passed But Returns a Value
Example 3: Argument Passed But No Return Value