What is a variable and how is it used in a program?

What will be an ideal response?

Suppose the location myNumber is a variable. A variable is a named memory location whose value can vary-for example, the value of myNumber might be 3 when the program is used for the first time, and 45 when it is used the next time.

Computer Science & Information Technology

You might also like to view...

The term ________ refers to malicious software, such as adware and spyware

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which code fragment below fills an M ? N matrix with the products of corresponding elements of M ? N matrices p and q?

a. m = p * q; b. for ( int i = M; i < N; ++i ) m[i] = p[i] * q[i]; c. for ( int i = 0; i < M; ++i ) for ( int j = 0; j < N; ++j ) m[i][j] = p[i][j] * q[i][j]; d. for ( int i = 0; i < M; ++i ) for ( int j = i; j < N; ++j ) m[j][i] = p[j][i] * q[j][i];

Computer Science & Information Technology