CS 2060 mid2

¡Supera tus tareas y exámenes ahora con Quizwiz!

+, \ and $ are all examples of _________ a) special characters b) strings c) operators d) literals

a

A field width _______ be included in the format control string of the scanf statement a) can b) cannot c) must d) none of these

a

Conversion specifiers g or G always prints ______ a) no trailing zeroes b) one trailing zero c) as many trailing zeroes as are in the number itself d) a default of six trailing zeroes

a

The highest level of data access is granted by a a) non-pointer to non-constant data b) non-constant pointer to constant data c) constant pointer to non-constant data d) Constant pointer to constant data

a

The___________, or the address operator, ia a unary opperatir that returns the address of its operand. a) & b) && c)* d)**

a

Which of the following statements is false? a) a key feature of functions like printf_s and scanf_s that they have runtime pointers constraints that are checked after attempting to use the pointers b) In a scanf_s if any of the pointer arguments (includung the format-control string) are NULL, the function returns EOF c)In a printf-S, if the format-control string or any argument that corrosponds to a %s is NULL, the function stops outputing and returning a negative number. d) none of the above

a

_______ values can consist of the digits 0 - 9 and the letter A - F a) hexadecimal b) octal c) binary d) decimal

a

in C, it is appropriate to that a string is a(n)_____ a) pointer b) integer c) double quote d) sequence of characters contained in a single quoute

a

%g conversion specifier indicates _______ a) color b) significant digits c) a global variable d) a hexadecimal integer

b

(*max)(num1,num2,num3) a) is the header for function max b) is a call to function max c) is the prototype for function max d) is part of a indefinition of a pointer to the function max

b

A character constant is a(n) ________ value represented as a character in single quotes. A) short b) int c) long d) double

b

A non-pointer variable names ____ references a value and a pointer variable name _______ references a value a)directly,directly b)directly,indirectly c)indirectly,directly d)directly,directly

b

Conversion specifier c requires a(n) _____ argument a) pointer to char b) char c) integer d) ASCII numeric

b

Conversion specifiers e and E always print exactly ____ to the left of the decimal point a) 0 b) 1 c) 2 d) 3 digits

b

The %i conversion specifier is not capable of inputting whihc type of data? a) hexadecimal b) binary c) octal d) decimal

b

When calling a function with arguments that should be modified, the___________ of those arguments are passed a) memory b) addresses c) values d) complements

b

A string array a) stores an actual string in each of its elements b) can only provide access to strings of a certain length c) is actually an array of pointers d) is always less memory efficent than an equivalent double-subscripted array

c

ASCII and EBCDIC are a) characters b) strings c) character sets d) character comparison operator

c

An algorithm that could execute for an unknown amount of time because it depends on random number to exit a function may a) have a redundancy b) get caught in an infinite loop c) suffer from indefinite postponement d) is a compiler error

c

Assuming that t is an array and tPtr is a pointer to that array, what expression refers to the address of the element 3? a)*(tPtr+3) b)tPtr[3] c)&t[3] d)*(t+3)

c

The statement: printf("%*.*f", 7, 2, 98.736); uses _____ for precision, ______ for the field width and outputs the value 98.74 _____. a) 7, 2, right justified b) 2, 7, left justified c) 2, 7, right justified d) 7, 2 left justified

c

The unary * and ________________ are complements of one another a)/ b)^ c)& d)|

c

Three of the following expressions have the same values. Which of the following's values is different from the others? a)*&Ptr b)&*Ptr c)*Ptr d)Ptr

c

Which of the following gives the number of elements in the array int r[] a) sizeof(r) b) sizeof(*r) c) sizeof(r)/sizeof(int) d) sizeof(*r)/sizeof(int)

c

Which statement is false? a) The uninary * operator is called the inderection oprator or the dereferencing operator b)The operand of the uninary * operator must be a pointer c) the unary * operator returns the value of the operand d)placing a * operator before a pointer derefrencing the pointer

c

Which statement is false? a) all functions calls in c pass arguments call-by-value b) call-by-reference enables a called function to modify variables in the calling function c) call-by-value is always more efficient than call-by-reference d) in c, programmers use pointers and the indirection operator to simulate call-by-reference

c

Whihc function does not read data from standard input? a) scanf b) sscanf c) sprintf d) getchar

c

Whihc of the following would output a "%" sign when used in the format control string of a printf statement a) %/ b) /% c) %% d) none of these

c

pointers are variables that contains ______________ as their values a) strings b) flowlines c) memory addresses d) directions

c

A string in C is ________________ a) an array of characters ending in the empty string b) a sequence of characters contained within single quotes c) a sequence of characters preceded by a length field d) an array of characters ending in the null character

d

Pointers may be assigned to which of the following A) all integer values b) an address c) null d) both b and c

d

The %e conversion specifier displays ____ values a) long b) character c) integer d) floating-point

d

The integral type of value returned by operator sizeof is _________ a) size-t b) sizet c) size.t d) size_t

d

The isxdigit (is hex digit) function would return false on a) a b) A c) 2 d) g

d

The least access privilege is granted by a _____ pointer to __________ data a) non-constant, non-constant b) non-constant, constant c) constant,non-constant d) constant,constant

d

Which character handling library function converts lowercase letters to uppercase letters? a) lowertoupper b) isupper c) touppercase d) toupper

d

Which is not part of a format control string? a) conversion specifiers b) flags c) field widths d) printf

d

Which of the following statements is false? a) in c, a string is essentially a pointer to the first character b) Arrays may contain pointers c) Each entry in an array of strings is actually a pointerti the first character of a string d) The string of an array of strings is the sum of the lengths of the strings

d

sizeof a) is a binary operator b) returns the total number of elements in an array c) usually returns a double d) returns the total number of bytes in an array

d

when the_______ of a variable is passed to a function, the indirection oprator (*) may be used in the function to modify the _________ at that location in the caller's function a) addresses,address b)value,address c)value,value d)address,value

d


Conjuntos de estudio relacionados

GEOL 105 Geology of Colorado CMU

View Set

Managerial Accounting Chapter 11: Performance Management FINAL EXAM

View Set

EMT - Chapter 30: Abdominal and Genitourinary Injuries, EMT - Chapter 31: Orthopaedic Injuries, EMT - Chapter 32: Environmental Injuries, EMT - Chapter 33: Obstetrics and Neonatal Care, EMT - Chapter 34: Pediatric Emergencies, EMT - Chapter 35: Geria...

View Set