You are on page 1of 1

Functions:

A function is a block of code that performs a specific task.

Suppose we need to create a program to create a circle and color it. We can create
two functions to solve this problem:

 a function to draw the circle

 a function to color the circle

Dividing a complex problem into smaller chunks makes our program easy to
understand and reusable.

There are two types of function:

1. Standard Library Functions: Predefined in C++


2. User-defined Function: Created by users

You might also like