-
2. 1, True 2, False (there is only one program) 3, False (not necessarily) 4, True.
3. 1. Integer x>10 &&&x 4. The former is the string "a", and the latter is the character "a" 5. *p1=*p2 temp 0 n < array[j], array[j+1].
Fourth, you have written it all.
5. 1. The function add() does not return a value, but returns a value, and the parameter x and the defined single-precision x are defined repeatedly, and the position should be in front of or at the beginning of the main() function (at least before it is called, otherwise it will say that the function cannot be found when compiled) or in main().
Forward declaration: int add(int x,int y); (Assuming the return value of the function is an integer).
In addition, I found that the ** I copied has the "" in Chinese, which is not allowed in the language, it must be English"", I don't know if it's like this in the question, or because of other reasons (the same below).
2、b=a;Wrong. A and b are both array names, and they both have fixed addresses in memory, and they are constant addresses, which cannot be changed.
3. The order of the initialization of the structure array is not the same as the order of the declaration, if it is in the order of the declaration, when initializing, the student number should be written before and the name should be written, or when defining the structure, the order of the two variable declarations should be reversed). On the penultimate line, a pointer to a string is assigned to a structure pointer, which is not allowed, because the pointer must also be of the same type when assigning a value. The last sentence, assuming the previous sentence is true, p is already a pointer to a string and can no longer use ->
-
Made some, two 1 pairs, 2 to 4 wrong.
Three 1 integer, 2 x>10&&x<100 4The former is the character a, and the latter is the character constant. ,temp
b) 1.Right 2False 3False 4Wrong.
c) 1.Null type.
2.(x>10&&x<100)
4. "a"is a string with a size of 2'a'is a character with a size of 15 *p1=*p2;
temp;i-1;
swap(arry[j],arry[j+1]);
4) You already have the answer.
f) 1.The function is defined after the main function, and is to be declared in the reference;
Also, null-type functions can't return values; So to define it as int add(), that is, add an int add(int x, int y); Arrays can't be defined like this; scanf(“%c”,&a[i]);You should get rid of &, right?
3.I don't understand, it seems incomplete;
-
#include
#include
#definepi
voidmain()
double
r,s1,s2,c;intn;
The number of sides of the inscribed regular polygon should be an integer, right?
scanf("%lf
d,&r,n
c=2*pi/n;s1=
2*n*r*r*sin(c);
Change to floating-point number.
integers are divided, leaving only integer digits).
s2=pi*r*r;
printf("%.2lf,.2lf",s2,s1);
Test Results:
-
a) 2 is not an lvalue and cannot be self-added.
b) is a comma expression, consisting of two expressions, a=3 and 5. You'd better explain the priority of a C language operator, and when you encounter this kind of operation, you can tell which operator to calculate first.
c) A+1 is not an lvalue and cannot be assigned. This brings the knowledge of priority to the knowledge that the assignment operator is calculated from right to left.
d) Floating-point numbers cannot be calculated with the remainder operator (which may also be called modulo arithmetic).
This problem requires understanding that the system allocates memory to static variables when compiling, and the memory units occupied by them are not released after the function call ends, that is, the value of the variable is the value of the previous function call at the next function call. >>>More
Define the struct:
typedef struct _legaladdress_{ >>>More