1.填空
1、 are used to document a program and improve its readability.
2、What, if anything, prints when each of the following C statements is performed? If nothing prints, then answer “nothing.”
Assume x = 2 and y = 3.
a)printf( "%d = %d", x + y, y + x );
b) z = x + y;
A location in the computer's memory that may contain different values at various times throughout the execution of a program is called a
Write a single pseudocode statement that indicates:Assign the sum of variables x, y, and z to variable p.
The solution to any problem involves performing a series of actions in a specific
A synonym for procedure is
7、State which values of the control variable x are printed by each of the following for statements:
a)for ( x = 2; x <= 13; x += 2 )
printf( "%d\n", x );
b) for ( x = 3; x <= 15; x += 3 )
printf( "%d\n", x );
8、Show the value of x after each of the following statements is performed:x=7.5
a) x = fabs( x);
b) x = floor( x);
C stores lists of values in
10、 The contents of a particular element of an array is called the of that element.
11、The name of the element in row 3 and column 5 of array d is .
12、Write statements to accomplish each of the following:
a) Display the value of the seventh element of character array f.
b) Copy array a into the first portion of array b. Assume double a[ 11 ], b[ 34 ];
13、Consider a 2-by-5 integer array t.
a) Write a definition for t.
b) How many elements does t have?
Write for statements that print the following sequences of values:
1, 2, 3, 4, 5, 6, 7
Write statements that assign random integers to the variable n in the following ranges:
–3 ≤ n ≤ 11
选择
variable used in lambda1. The function inputs values from the keyboard is ( ).
A.scanf B.printf C.while D.main
2.Input three integer values from the keyboard and place these values in integer variables a, b and c.
A.scanf(“%d%d%d”, a, b, c ) B.printf(“%d%d%d”, a, b, c)
C.scanf(“%d%d%d”, &a, &b, &c ) C.printf( “%d%d%d”, &a, &b, &c )
3.Which contents will display on the screen while you write the statement printf("a = 5;");
A. printf("a = 5;") B.5 C.a = 5 D.a = 5 ;
4. Which one is invalid variable names?
A.3g B.while C.cut.out D.EATING
5.Which, if any, of the following C statements contain variables involved in destructive read-in?
a) scanf( "%d%d%d%d%d", &b, &c, &d, &e, &f );
b) p = i + j + k + 7;
c) printf( "Destructive read-in" );
d) printf( "a = 5" );
6.Given the equation y = ax3 + 7, which of the following, if any, are correct C statements for this equation?
A) y = a * x * x * ( x + 7 );
B) y = ( a * x ) * x * ( x + 7 );
C) y = ( a * x ) * x * x + 7;
D) y = a * x * ( x * x + 7 );
7. Show the value of equator x = ( 3 * 9 * ( 3 + ( 9 * 3 / ( 3 ) ) ) ); after C statement is performed.
A.324 B.338 C.108 D.124
The item written inside a decision symbol is called a ( )
A.flowline B.condition C. algorithm D. assignment
Which C statement is true?
printf(“%d\n”, x ); B. While ( counter <<= 100 );
C.for ( x = =3; x <= 15; x += 3 ) D. counter ++2;
Which values of the control variable x are printed?
for ( x = 5; x <= 22; x += 7 )
printf( "%d\n", x );
A.5, 9,12 B.6,9,12 C.6,12,19 D.5,12,19
Write for statements that print the following sequences of values:1, 2, 3, 4, 5, 6, 7
for ( i = 1; i <= 7; i++ )printf( “%d ”, i );
B.for ( i = 0; i <= 7; i++ )printf( “%d ”, i );
C.for ( i = 1; i < 7; i++ )printf( “%d ”, i );
D.for ( i = 0; i < 7; i++ )printf( “%d ”, i );
How many @ will be printed by follow statement?
x=3;y=3;
for ( i = 0; i <= y; i++ ) {
for ( j = 1; j < x; j++ ) {printf( "@" ); } }
A.6 B.4 C.9 D.8
Which statement is used to shift to another line after print a string.
printf( “The product of %d and %d is %d”\n, x, y, z );
B. printf( “The product of %d and %d is %d\n”, x, y, z );
C. printf( “The product of %d and %d is %d\n”, &x, &y, &z );
D. printf( “The product of %d and %d is %d”\n, &x, &y, &z );
14.The function used to display information on the screen is ( )
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论