If c is a character variable that contains a digit, what does the following function return?

int digit_to_int(char c)
{
return ( int(c) – int('0'));
}

a. The ASCII value of c
b. The character value of c
c. The integer equivalent of the digit stored in c
d. none of the above


c. The integer equivalent of the digit stored in c

Computer Science & Information Technology

You might also like to view...

If c is a character variable that contains a digit, what does the following function return?

int digit_to_int(char c) { return ( int(c) – int('0')); } a. The ASCII value of c b. The character value of c c. The integer equivalent of the digit stored in c d. none of the above

Computer Science & Information Technology

Which of the following is not a property of a recursive solution to a problem?

a) There is at least one stopping case of the problem that has a nonrecursive solution. b) Most cases of the problem can be reduced to a case that is closer to a simple case. c) Eventually the problem can be reduced to stopping case(s). d) The recursive step leads to a more complicated case.

Computer Science & Information Technology

When the address of a data variable is passed to a function, what type of call is used?

A. Call by reference B. Call by value C. Call by indirection D. Both A and C

Computer Science & Information Technology

What is the output of the following code?

``` ArrayList list = new ArrayList(); java.util.Date d = new java.util.Date(); list.add(d); list.add(d); System.out.println((list.get(0) == list.get(1)) + " " + (list.get(0)).equals(list.get(1))); ``` a. true false b. false true c. true true d. false false

Computer Science & Information Technology