Comma operator is used in for statement. If we want to initialize two or more related indices at the same time and if we want to increment or decrement more than one variable, we can use the comma operator in for loop.for (expression1a, expression1b ; expression 2; expression 3)
Here expression1a and expression 1b are two expressions separated by comma operator. They will initialize two separate indices.for (expression1; expression2; expression 3a, expression 3b)
Here expression3a and expression 3b are separated by comma operator. They are used to alter two different indices used simultaneously within the loop.
Only one expression is allowed in the test expression.
E.g.for (j = 0, k = 3; j < k ; j = j + 2, k++)
C Related Interview Questions
|DBMS Interview Questions||C++ Interview Questions|
|C & Data Structures Interview Questions||Java Interview Questions|
|Go (programming language) Interview Questions||F Sharp (programming language) Interview Questions|
|C preprocessor Interview Questions||R Programming language Interview Questions|
|D Programming Language Interview Questions||Lua (programming language) Interview Questions|
|Embedded C Interview Questions|
Introduction To C-programming
Data Types And Storage Classes
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.