Computer Grade test experience: Be careful

Source: Internet
Author: User
Although you have a wide range of knowledge, the level test is not very deep. The basic part of the test is your ability to perform routine operations, Program The design is mostly based on your care. I have worked hard for half a year, and after two hours of battle in the test room, I am still very "self-satisfied" after I handed in the paper ", the "fail" on the transcript makes you unconfident in your eyes for a moment. When you carefully "taste" the answer, you will sigh n times ...... The original "culprit" is "not careful ". Looking at the questions over the past four years, I have summarized and analyzed typical examples that are prone to errors. In addition, I would like to increase immunity for my friends who will take the level 2 C examination later. This article will be published three times. In the first category, the question cannot be clarified. 1. The word difference during Question review. Make sure to find out the meaning of the question. The question allows us to choose "correct" or "Incorrect"; "can" or "no"; originally, we asked for a wrong answer, however, the question does not contain "error", but rather "... Please select the incorrect item. If you are not careful, You may select the most "correct" option as the answer, because "correct" has three options, of course, it is easy. In this way, "errors" are easily slipped away from your pen tip. 2. Do not pay attention to the requirements and instructions in the text section. Many times, in order to save time, you can come up and check the program. This will not only save time, but also lead to detours and errors. Let's take a look at the two examples below! Example 1: In the following program, function f sorts n strings in ascending order. The following is a reference segment: # include void F (char P [] [10], int N) {omitted} Main () {char P [] [10] = {"ABC", "aabdfg", "abbd", "dcdbe", "cd"}; int I; F (p, 5); printf ("% d/N", strlen (P [0]);} the output result after the program runs is (a) 6 (B) 4 (c) 5 (d) 3 (to save the layout, skip the content of function f .) After reading the text instructions and then reading the main function, you can lock the string to "dcdbe" without having to spend time analyzing function f. Note: Do not treat the longest string as the largest string. If you look at "aabdfg", it will be wrong. The answer should be C. Example 2: In the following program, allocate three double dynamic memory units to pointer P. Fill in the blanks. The following is a reference snippet: # include main () {Double P; P = (double) malloc ([]); P [0] = 1.5; P [1] = 2.5; P [2] = 3.5; printf ("% F/N", P [0], p [1], p [2]);} if we look at the program, we will ignore "allocating three double dynamic memory units to pointer P". Here we need "three". If we write sizeof (double) with a large stroke) it is too embarrassing. In fact, it should be 3 sizeof (double ). In the second type, the "value assignment" is considered as "equal to". For example, the following program segment int K = 0 while (k = 1) K ++ is provided. The number of while loop executions is: (a) unlimited times (B) There is a syntax error. It cannot be executed (c) once or not (d) once. If K is equal to 1, the loop is executed, then "K ++" is not executed, and the value of K is always 0. Then C is selected. In fact, the condition of the while loop is a value expression, and the answer is. Although the Level Test (Written Examination) has a wide range of knowledge, it is not very deep. The basic part of the test is your ability to perform routine operations, and most of the program design is to test your care. I have worked hard for half a year, and after two hours of battle in the test room, I am still very "self-satisfied" after I handed in the paper ", the "fail" on the transcript makes you unconfident in your eyes for a moment. When you carefully "taste" the answer, you will sigh n times ...... The original "culprit" is "not careful ". Looking at the questions over the past four years, I have summarized and analyzed typical examples that are prone to errors. In addition, I would like to increase immunity for my friends who will take the level 2 C examination later. This article will be published three times. In the first category, the question cannot be clarified. 1. The word difference during Question review. Make sure to find out the meaning of the question. The question allows us to choose "correct" or "Incorrect"; "can" or "no"; originally, we asked for a wrong answer, however, the question does not contain "error", but rather "... Please select the incorrect item. If you are not careful, You may select the most "correct" option as the answer, because "correct" has three options, of course, it is easy. In this way, "errors" are easily slipped away from your pen tip. 2. Do not pay attention to the requirements and instructions in the text section. Many times, in order to save time, you can come up and check the program. This will not only save time, but also lead to detours and errors. Let's take a look at the two examples below! Example 1: In the following program, function f sorts n strings in ascending order. The following is a reference segment: # include void F (char P [] [10], int N) {omitted} Main () {char P [] [10] = {"ABC", "aabdfg", "abbd", "dcdbe", "cd"}; int I; F (p, 5); printf ("% d/N", strlen (P [0]);} the output result after the program runs is (a) 6 (B) 4 (c) 5 (d) 3 (to save the layout, skip the content of function f .) After reading the text instructions and then reading the main function, you can lock the string to "dcdbe" without having to spend time analyzing function f. Note: Do not treat the longest string as the largest string. If you look at "aabdfg", it will be wrong. The answer should be C. Example 2: In the following program, allocate three double dynamic memory units to pointer P. Fill in the blanks. The following is a reference snippet: # include main () {Double P; P = (double) malloc ([]); P [0] = 1.5; P [1] = 2.5; P [2] = 3.5; printf ("% F/N", P [0], p [1], p [2]);} if we look at the program, we will ignore "allocating three double dynamic memory units to pointer P". Here we need "three". If we write sizeof (double) with a large stroke) it is too embarrassing. In fact, it should be 3 sizeof (double ). In the second type, the "value assignment" is considered as "equal to". For example, the following program segment int K = 0 while (k = 1) K ++ is provided. The number of while loop executions is: (a) unlimited times (B) There is a syntax error. It cannot be executed (c) once or not (d) once. If K is equal to 1, the loop is executed, then "K ++" is not executed, and the value of K is always 0. Then C is selected. In fact, the condition of the while loop is a value expression, and the answer is. Although the Level Test (Written Examination) has a wide range of knowledge, it is not very deep. The basic part of the test is your ability to perform routine operations, and most of the program design is to test your care. I have worked hard for half a year, and after two hours of battle in the test room, I am still very "self-satisfied" after I handed in the paper ", the "fail" on the transcript makes you unconfident in your eyes for a moment. When you carefully "taste" the answer, you will sigh n times ...... The original "culprit" is "not careful ". Looking at the questions over the past four years, I have summarized and analyzed typical examples that are prone to errors. In addition, I would like to increase immunity for my friends who will take the level 2 C examination later. This article will be published three times. In the first category, the question cannot be clarified. 1. The word difference during Question review. Make sure to find out the meaning of the question. The question allows us to choose "correct" or "Incorrect"; "can" or "no"; originally, we asked for a wrong answer, however, the question does not contain "error", but rather "... Please select the incorrect item. If you are not careful, You may select the most "correct" option as the answer, because "correct" has three options, of course, it is easy. In this way, "errors" are easily slipped away from your pen tip. 2. Do not pay attention to the requirements and instructions in the text section. Many times, in order to save time, you can come up and check the program. This will not only save time, but also lead to detours and errors. Let's take a look at the two examples below! Example 1: In the following program, function f sorts n strings in ascending order. The following is a reference segment: # include void F (char P [] [10], int N) {omitted} Main () {char P [] [10] = {"ABC", "aabdfg", "abbd", "dcdbe", "cd"}; int I; F (p, 5); printf ("% d/N", strlen (P [0]);} the output result after the program runs is (a) 6 (B) 4 (c) 5 (d) 3 (to save the layout, skip the content of function f .) After reading the text instructions and then reading the main function, you can lock the string to "dcdbe" without having to spend time analyzing function f. Note: Do not treat the longest string as the largest string. If you look at "aabdfg", it will be wrong. The answer should be C. Example 2: In the following program, allocate three double dynamic memory units to pointer P. Fill in the blanks. The following is a reference snippet: # include main () {Double P; P = (double) malloc ([]); P [0] = 1.5; P [1] = 2.5; P [2] = 3.5; printf ("% F/N", P [0], p [1], p [2]);} if we look at the program, we will ignore "allocating three double dynamic memory units to pointer P". Here we need "three". If we write sizeof (double) with a large stroke) it is too embarrassing. In fact, it should be 3 sizeof (double ). In the second type, the "value assignment" is considered as "equal to". For example, the following program segment int K = 0 while (k = 1) K ++ is provided. The number of while loop executions is: (a) unlimited times (B) There is a syntax error. It cannot be executed (c) once or not (d) once. If K is equal to 1, the loop is executed, then "K ++" is not executed, and the value of K is always 0. Then C is selected. In fact, the condition of the while loop is a value expression, and the answer is. The third type is the value of the expression and the value of the variable. For example, the following program references the reference segment: int A = 2; int F (int A) {return (a) ++ ;} main () {int S = 0; {int A = 5; S + = f (& A) ;}s + = f (& ); printf ("% d/N", S);} after execution, the output result is () (a) 10 (B) 9 (c) 7 (d) 8. The answer is C. This question has two main points: 1 is the scope of the local variables and global variables, 2 is the value of the expression (a) ++ returned by function f (&, instead of the value of. Class 4: relational expressions are different from mathematical relational expressions. For example, the following program references: Main () {int A = 5, B = 4, C = 3, D = 2; If (A> B> C) printf ("% d/N", d); else if (C-1> = d) = 1) printf ("% d/N", D + 1); else printf ("% d/N", d + 2);} after execution, the output result is () () 2 (B) 3 (c) 4 (d) errors occur during compilation. If no result is found, the key to this question is (A> B> C). The answer is, if 5 is greater than 4 or greater than 3, the entire expression is regarded as the true value. In fact, A> B is already the true value, and 1> C is a false value, so the answer is B. Category 5: copy a string to the same character. Example: If the statement is defined: Char s [100], d [100]; Int J = 0, I = 0;, and the string has been assigned in S. Please fill in the blanks to copy the string. (Note: Do not use a comma expression) while ([I]) {d [J] = []; j ++;} d [J] = 0; it is easy to see only the current one. If other characters are ignored, the value is s [I] by mistake. The answer is s [I ++].
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.