I don t understand the simple sentences of the C language

Updated on technology 2024-02-09
3 answers
  1. Anonymous users2024-02-05

    a1.For the literal constant 4, the compiler thinks that it is int and double, so although the value of 4 3 is equal to, when it is converted to an integer, it is 1, and for that expression, its result is double, so the decimal part can be preserved. The knowledge involved in this question is an implicit conversion of types.

    The function accepts an integer argument and returns its absolute value, while the fabs() function accepts a double argument and returns its absolute value, e.g., now a=, then abs(a) is 0 and fabs(a) is.

    a3.When using the scanf() function to input, %f is used to get a float value, 4 bytes, and %lf is a double, 8 bytes, which are different.

    a4.For if-else statements, you can use the else if you do not need to perform other actions when the conditions are not met.

    For a series of if-elses, as long as you pay attention to the match of else, then the last else can be omitted, and the conditions are the same as above. If you omit the else in the middle, then you will split an if-else into multiple statements.

    The difference between if ()else and if () is that the former is a statement, that is, statement 1 and statement 2 have and only one execution; The latter is two statements, i.e. statement 2 is necessarily executed, it does not belong to if-else, you can remove the curly braces from it.

    If there is any problem, you can send a message again. Hope.

  2. Anonymous users2024-02-04

    The difference between initialization and non-initialization is right; If it is not initialized, then the value of pt is the value randomly given by the system, which is uncertain;

  3. Anonymous users2024-02-03

    The question you asked first starts with breaking down the problem:

    1. Function 1 implements a binary method to find a character in an array of characters.

    2. Function 2 uses a dichotomy to find a string (word) in an array of strings (each string is an English word).

    3. Function 3 realizes the sorting of word arrays (the dichotomy is the search for ordered arrays, which must be sorted first).

    4. Function 4 recognizes and disassembles any string, disassembles all English words in it, and stores the array (the size of the array is still uncertain, and dynamic array implementation or linked list is required).

    5. The dichotomy also needs to be written in two ways: ordinary functions and recursion.

    6. The input line of strings, no format restrictions, no content restrictions, what is the basis for word recognition, such as containing other characters:"book@*shop"You are splitting it into two words, or a word.

    With that in mind, how do you want to simplify the statement?

Related questions
4 answers2024-02-09

It's not very hard that the tail node next points to null. >>>More

7 answers2024-02-09

#include

using namespace std; >>>More

8 answers2024-02-09

It's nonsense to say so much above. Landlord please see: pay attention to your program: printf("%d,%d",(a,b),(b,a); >>>More

9 answers2024-02-09

It should be 0It should be a remainder operation.

8 answers2024-02-09

The C language program written according to the requirements of the topic is as follows. >>>More