Given a variable d of type int has been declared and the following function headers.
int f1(int a);
void f2(int &n);
bool f3(int r, char c);
Which of the following statements has a syntax error?
A. cout << f1(10);
B. f2(d);
C. if (f3(f1(d), 'x')) {
++d;
}
D. f2(10);

Respuesta :

As f2() expects a variable, but a constant has been provided, (D) has incorrect syntax.

What is a variable?

A variable in programming is a value that is subject to change based on external factors or input. Typically, a program is made up of data that the program uses while it is running and instructions that tell the computer what to do.

Constants or fixed values that never change make up the data, while variables (whose initial values are typically set to "0" or some other default value because the program's user will supply the actual values) are also present. In most cases, certain data types are used to define both constants and variables.

The form of the data is dictated by and constrained by each data type. Examples of data types include a decimal representation of an integer or a string of text characters that is typically constrained in length.

Learn more about variables

https://brainly.com/question/2804470

#SPJ4