KEY7

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

ABD

In C, incorrect order(s) of a function implementation: Choose at least one answer. a. Return type, body, function name, parameters b. Return type, body, parameters, function name c. Return type, function name, parameters, body d. Return type, parameters, body, function name

ADE

In C, which of these statements are not true? Choose at least one answer. a. #include "filename" using with filename locate in system directory. b. We can collect function prototypes into a file and refer to the file in our program c. We use the #include directive to instruct the compiler to insert a copy of the header file into our source code. d. #include <filename> using with filename locate in user directory e. # is a symbol of postprocessor indicators

...d

In C, with reference to property of reusing a function, the function that will check whether an integer is a prime or not, should be declared as ........ Choose one answer. a. a void function. b. a function that returns a real number. c. a function that will return an integer. d. None of the others e. a function that returns a string a characters.

...c d

Select correct statement(s). Choose at least one answer. a. Actual parameter is a parameter in function implementation. b. Formal parameter is a parameter that is transfered to a function when it is called. c. Actual parameter is a parameter that is transfered to a function when it is called. d. Formal parameter is a parameter in function implementation.

C D E

Select correct statement(s). Choose at least one answer. a. Walkthrough is a process in which any change in codes is recorded. b. Walkthrough process is used for evaluating the performance of a program. c. A table that contains all program variables is used in walkthrough process. d. Walkthrough is a manual process for recording all changes of program variables when the program executes instruction-by-instruction. e. A listing of the output, if any, produced by the program is carried out when we do a walkthrough..

acd

Select incorrect statements. Choose at least one answer. a. The specifier %hex is used for printing out an integer in hexadecimal format. b. The specifier %e is used for printing out a real number in scientific format. c. The specifier %u is used for printing out a unsigned integer. d. The specifier %b is used to print out an integer in binary format.

...a d

Select the statements that belong to low cohesion Choose at least one answer. a. "logical" - related tasks of which only one is performed - the module identifier suggests a choice b. "functional" - performs a single specific task - the module identifier suggests a precise verb phrase c. "communicational" - the tasks share the same data - all tasks are carried out each time d. "coincidental" - unrelated tasks

D

Study the following function: int t (int x, int y, int z) { return x+y+z>20 ? 10 : 20; } If this function is called as following with input data are 5 10 15. What is the output? int a,b,c; printf("Enter 3 integers:"); scanf("%d%d%d", &a, &b, &c); printf("%d", t(b,c,a)); Choose one answer. a. None of the others. b. 20 c. -10 d. 10

C

Study the function implementation and a case of using this function. int t (int x, int y) { return x-y; } ... char c1= 'A', c2= 'D'; printf("%d", t(c2, c1)); Suppose that the above codes execute. What is the output? Choose one answer. a. An error is thrown when they are executed. b. No output is printed out. c. 3 d. -3

B

Suppose that all needed libraries are included / int main() { int n, m; int result = scanf("%d%d",&n, &m); printf("%d", result); getch(); return 1; } What is the ouput of the above program if input is 12asd45 ? Choose one answer. a. a non-predictable value. b. 1 c. 3 d. 2 e. An error is thrown when it executes.

c

Suppose that all needed libraries are included / int main() { int n, m; scanf("%d,%d",&n, &m); printf("%d, %d", n, m); getch(); return 1; } When the program executes, user enters 9 100 . What is output? Choose one answer. a. Two non-predictable values. b. No output is printed out. c. 9 and a non-predictable value. d. An error when it executes.

D

Suppose that all needed libraries are included / int main() { int n; char c; scanf("%d",&n); c=getchar(); printf("%d, %d", n,c); getch(); return 1; } What is the output of the above program if user enters the keys 12 and ENTER? Choose one answer. a. Non-predictable values. b. 12 c. No output is printed out. d. 12, 10 e. 12, 13

C

Suppose that the following codes execute and input data are 9 and 12. int m,n; printf("Enter two integers:"); scanf("%d%d",&m, &n); if (m>10 && n<20) printf("%d", m+n); else printf("%d", m-n); What is the output. Choose one answer. a. None of the others. b. 21 c. -3 d. 3

a

Suppose that the following codes execute. What is the output. int n=3, m=7; int p1= &n, p2=&m; p1 -= m+n- 3(*p2); *p2 += m-n; printf ("%d", m+n); Choose one answer. a. 14 b. 16 c. 12 d. 20 e. 18

E

Suppose that the following codes execute. What is the output? long S=10; long i; for (i=1; i<10; i++) if (i%3==0) S+=i; printf("%ld", S); Choose one answer. a. 19 b. 31 c. 16 d. 22 e. None of the others.

B

The getchar function can do Choose one answer. a. clearing the buffer automatically after retrieving b. None of the others c. treats the whitespace between the input values as a separator d. retrieves data values from every keystroke directly

d

Validation do not include Choose one answer. a. out-of-range input b. invalid characters c. trailing characters d. None of the others e. incorrect number of input fields

B

What is the output if the following code executes. int n=3, m=7; int p1= &n, p2=&m; p1 -= m+n- 3(*p2); p2 += p1%2 ? 2 : 5; printf ("%d", m-n); Choose one answer. a. -5 b. None of the others. c. -4 d. 6 e. 4

e

What is the output of the following program? / Suppose that all needed libraries are included / int main() { double x= 3.5, y= 6.8 , z= 1.5; int n= floor( x )+ ceil( y )+ z; printf("%d", n); getch(); return 1; } Choose one answer. a. 12 b. 10 c. 11.5 d. The program causes an error when it is compiled. e. 11

C

What library includes function to generate random numbers? Choose one answer. a. conio.h b. stdio.h c. stdlib.h d. math.h

d

Which of these statements about format string are not true? Choose one answer. a. size identifies the size of data type of the value passed. b. % flags width . precision size conversion_character c. - describes left justification of the converted value in its field d. None of the others e. 0 pads the field width with leading zeros

...e

Which of these statements about the function is true? Choose one answer. a. All of the others b. The body is the code block that contains the module instructions and generates the return value c. A function definition consists of a header and a body d. A function that does not return a value is called a subroutine or procedure in other languages e. A function may receive data and may return a value

...c d e

Which of these statements about the scanf function are true? Choose at least one answer. a. The return code from scanf reflects success of %* conversions b. scanf retrieves data values from every keystroke directly c. interpreted and processed the entire format string d. scanf treats the whitespace between the input values as a separator e. If the buffer is empty, the function scanf will wait until the user adds more data values


संबंधित स्टडी सेट्स

OLABs 9-36 (a.p. java programming)

View Set

Quiz 2: Atoms, Molecules, Properties of Water and pH

View Set

American History Unit 2 (11th Grade)

View Set

Study.com Chapter 2,3, Health Care Delivery System

View Set

Biology Chapter 20 Homework + Module

View Set