- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is evaluation order of function parameters in C?
We pass different arguments into some functions. Now one questions may come in our mind, that what the order of evaluation of the function parameters. Is it left to right, or right to left?
To check the evaluation order we will use a simple program. Here some parameters are passing. From the output we can find how they are evaluated.
Example Code
#include<stdio.h> void test_function(int x, int y, int z) { printf("The value of x: %d
", x); printf("The value of y: %d
", y); printf("The value of z: %d
", z); } main() { int a = 10; test_function(a++, a++, a++); }
Output
The value of x: 12 The value of y: 11 The value of z: 10
From this output we can easily understand the evaluation sequence. At first the z is taken, so it is holding 10, then y is taken, so it is 11, and finally x is taken. So the value is 12.
- Related Articles
- Order of evaluation in C++ function parameters
- Evaluation order of operands in C++
- What are default-parameters for function parameters in JavaScript?
- What are function parameters in JavaScript?
- What is Evaluation, Precedence and Association in C language?
- What are default function parameters in JavaScript?
- What is the evaluation of Association Patterns?
- Evaluation of Prefix Expressions in C++
- Evaluation of Expression Tree in C++
- JavaScript Function Parameters
- What is the best way to do optional function parameters in JavaScript?
- Evaluation of Risk in Investments in C++
- What is “Parameters without defaults after default parameters in JavaScript”
- What are named parameters in C#?
- Destructuring and function parameters in JavaScript

Advertisements