Programming in C: Unit III (a): Functions

Using Functions

Programming in C

In the second chapter we have discussed that when we execute a C program, the operating system calls the main() function of the program which marks the entry point for the execution.

USING FUNCTIONS

In the second chapter we have discussed that when we execute a C program, the operating system calls the main() function of the program which marks the entry point for the execution. When the program is executed, the main () returns some value to the operating system.

Any function (including main()) can be compared to a black box that takes in input, processes it, and then produces the result. However, we may also have a function that does not take any inputs at all, or the one that does not return anything at all.

While using functions we will be using the following terminologies:

• A function f that uses another function g is known as the calling function and g is known as the called function.

• The inputs that a function takes are known as arguments/ parameters.

• When a called function returns some result back to the calling function, it is said to return that result.

• The calling function may or may not pass parameters to the called function. If the called function accepts arguments, the calling function will pass parameters, else it will not do so.

• Function declaration is a declaration statement that identifies a function with its name, a list of arguments that it accepts, and the type of data it returns.

• Function definition consists of a function header that identifies the function, followed by the body of the function containing the executable code for that function.

Programming in C: Unit III (a): Functions : Tag: : Programming in C - Using Functions


Programming in C: Unit III (a): Functions



Under Subject


Programming in C

CS3251 2nd Semester CSE Dept 2021 | Regulation | 2nd Semester CSE Dept 2021 Regulation



Related Subjects


Professional English II

HS3251 2nd Semester 2021 Regulation | 2nd Semester Common to all Dept 2021 Regulation


Statistics and Numerical Methods

MA3251 2nd Semester 2021 Regulation M2 Engineering Mathematics 2 | 2nd Semester Common to all Dept 2021 Regulation


Engineering Graphics

GE3251 eg 2nd semester | 2021 Regulation | 2nd Semester Common to all Dept 2021 Regulation


Physics for Electrical Engineering

PH3202 2nd Semester 2021 Regulation | 2nd Semester EEE Dept 2021 Regulation


Basic Civil and Mechanical Engineering

BE3255 2nd Semester 2021 Regulation | 2nd Semester EEE Dept 2021 Regulation


Electric Circuit Analysis

EE3251 2nd Semester 2021 Regulation | 2nd Semester EEE Dept 2021 Regulation


Physics for Electronics Engineering

PH3254 - Physics II - 2nd Semester - ECE Department - 2021 Regulation | 2nd Semester ECE Dept 2021 Regulation


Electrical and Instrumentation Engineering

BE3254 - 2nd Semester - ECE Dept - 2021 Regulation | 2nd Semester ECE Dept 2021 Regulation


Circuit Analysis

EC3251 - 2nd Semester - ECE Dept - 2021 Regulation | 2nd Semester ECE Dept 2021 Regulation


Materials Science

PH3251 2nd semester Mechanical Dept | 2021 Regulation | 2nd Semester Mechanical Dept 2021 Regulation


Basic Electrical and Electronics Engineering

BE3251 2nd semester Mechanical Dept | 2021 Regulation | 2nd Semester Mechanical Dept 2021 Regulation


Physics for Civil Engineering

PH3201 2021 Regulation | 2nd Semester Civil Dept 2021 Regulation


Basic Electrical, Electronics and Instrumentation Engineering

BE3252 2021 Regulation | 2nd Semester Civil Dept 2021 Regulation


Physics for Information Science

PH3256 2nd Semester CSE Dept | 2021 Regulation | 2nd Semester CSE Dept 2021 Regulation


Basic Electrical and Electronics Engineering

BE3251 2nd Semester CSE Dept 2021 | Regulation | 2nd Semester CSE Dept 2021 Regulation


Programming in C

CS3251 2nd Semester CSE Dept 2021 | Regulation | 2nd Semester CSE Dept 2021 Regulation