0.097

五煦查题

快速找到你需要的那道考题与答案

超星Fundamentals of C Programming_1答案(学习通2023课后作业答案)

57 min read

超星Fundamentals of C Programming_1答案(学习通2023课后作业答案)

Chapter 1 Introducing C-2

Quiz 1 Introducing C

1、超星When compile a C program,答案 the comments will .
A、be compiled and appear in the object code.
B、学习be compiled,通课 but not appear in the object code.
C、not be compiled and not appear in the object code.
D、后作not be compiled,业答 but appear in the object code

2、A file written by C language .
A、超星can be executed immediately.
B、答案is 学习a source program.
C、can be executed after compilation.
D、通课can be executed after compilation and interpretation.

3、后作Many programming languages borrow heavily form C language,业答 including C++, C# .

4、One of C’s advantages is 超星efficiency. Because C was intended for applications where assembly language had traditionally been used, it was crucial that C programs could run quickly and in limited amounts of memory.

5、C’s weaknesses arise from the same source as many of its strengths: C’s closeness to the machine.

Chapter 2 Data Types and Expression -2

Quiz 2 DataType,答案 Variable and Constant

1、Which of the following is 学习a legal C identifier?
A、1stuNPU
B、Stu@NPU
C、stu-NPU
D、_stu_NPU

2、Which of the following is not keyword in C language?
A、do
B、int
C、void
D、main

3、Which of the following is NOT a constant in C language?
A、012
B、"a"
C、'\n'
D、'AB'

4、Which of the following is NOT a float constant in C language?
A、2.38
B、.23
C、1.2e-2
D、e-2

5、The three identifiers, weight, Weight and WEIGHT, are NOT equal in C language.

Chapter 2 Data Types and Expression -3

Quzi 3 Operators and Expression

1、In C language, which of the following operator requires its operands must be of type int?
A、/
B、*
C、=
D、%

2、Of which operation the precedence is higher than others’?
A、+
B、%
C、*
D、()

3、The value of the expression 3.6-5/2+1.2+5%2 is ____.
A、4.3
B、4.8
C、3.3
D、3.8

4、Suppose all variables in the following expressions have been declared and initialized, which of the following is NOT a legal expression in C language?
A、a = (2, b= c + 2)
B、(int)18.5%3
C、a = b += c + b
D、a := b + 1

5、If an expression is the sum of four data of different types, including int, long, double and char, the expression’s type is ____.
A、int
B、long
C、char
D、double

6、The expressions ++i and i++ are exactly NOT the same as (i += 1).

Chapter 3 program control structure -2

Quiz 4 Formatted Input & Output

1、If c is a variable of type char, which one of the following statements is illegal?
A、i += c; /*i has type int*/
B、c = 2*c – 1;
C、putchar(c);
D、printf(c);

2、Suppose that we call scanf as follows: scanf(“%d%f%d”, &i, &x, &j); If the user enters: 10.8 9 3↙ What will be the values of i, x, and j after the call? (Assume that i and j are int variables and x is a float variable. ↙ is used to represent Enter key)
A、10 9 3
B、11 9 3
C、10.8 9 3
D、10 0.8 9

3、Suppose that we call scanf as follows: scanf(“%f%d%f”, &x, &i, &y); If the user enters: 12.3 45.6 789 What will be the values of x, i, and y after the call? (Assume that x and y are float variables and i is an int variable. ↙ is used to represent Enter key)
A、12.3 45 789
B、12.3 45.6 789
C、12 45 789
D、12.3 45 0.6

4、Which one of the following is correct?
A、The output item must be given when calling function printf.
B、When calling function getchar to read in a character, we can input its corresponding ASCII code.
C、In C language, integers can be output in various forms, e.g. decimal, binary, octal and hexadecimal.
D、The header file stdio.h must be included before calling function putchar.

5、Assuming the following statements: char c1='1',c2='2'; c1=getchar(); c2=getchar(); putchar(c1); putchar(c2); If input a└┘↙ when run the code, ↙ is used to represent Enter key, └┘ is used to represent space, which one of the following statements is correct?
A、The program will wait for the second character input by user.
B、Variable c1 is assigned the character a, and c2 remains the character 2.
C、Variable c1 is assigned the character a, and c2 remains uncertain value.
D、Variable c1 is assigned the character a, and c2 is assigned the space character.

6、Given the following declarations and scanf function call statements, to make the value of a1, a2, c1, c2 to be 10, 20, A and B respectively. Which one of the following inputs is correct? ↙ is used to represent Enter key and └┘ is used to represent space. ( D ) int a1,a2; char c1,c2; scanf("%d%d",&a1,&a2); scanf("%c%c",&c1,&c2);
A、1020AB↙
B、10└┘20↙ AB↙
C、10└┘20└┘AB↙
D、10└┘20AB↙

7、Assuming the statement scanf("a=%d,b=%d,c=%d",&a,&b,&c); To make the values of a, b, and c to be 1, 3, 2 respectively, which of the following input is correct? ↙ is used to represent Enter key and └┘ is used to represent space.
A、132↙
B、1,3,2↙
C、a=1└┘b=3└┘c=2↙
D、a=1,b=3,c=2↙

8、If the variable x is of type double, which one of the following statements is right?
A、scanf("%f",x);
B、scanf("%f",&x);
C、scanf("%5.1f",&x);
D、scanf("%lf",&x);

9、What is the output of the following code? └┘ is used to represent space. float x=-1023.012; printf("%8.3f,",x); printf(" % 10.3f",x);
A、1023.012,-1023.012
B、–1023.012,-1023.012
C、1023.012,└┘-1023.012
D、–1023.012,└┘-1023.012

10、What is the output of the following code? int x=13,y=5; printf("%d",x%=(y/=2));
A、3
B、2
C、0
D、1

11、If we declared int a=1234;, what is the result when executing the statement printf("%2d",a);?
A、12
B、34
C、Error
D、1234

12、What is the output of the following code? int a; char c=10; float f=100.0; double x; a=f/=c*=(x=6.5); printf("%d %d %3.1f %3.1f",a,c,f,x);
A、1 65 1 6.5
B、1 65 1.0 6.5
C、2 65 1.5 6.5
D、1 65 1.5 6.5

13、Execute the following statements, if input 12345678↙,what is the output? int a , b ; scanf("%2d%*2d%3d",&a,&b); printf("%d",a+b);
A、46
B、5690
C、Error
D、579

14、C compilers are required to check that the number of conversion specifications in a format string matches the number of output items.

15、If the format string is “%d\n”, scanf will skip white space, read an integer, and then skip to the next non-white-space character. So a format string like this can cause an interactive program to “hang” until the user enters a nonblank character.

Chapter 3 program control structure -4

Quiz 5 Selection Structure

1、After the execution of the following statements: int a=1, b=2, c=3, d=4, m=2, n=2, cond; cond = (m=a>b) && (n=c>d); , which one of the following value is equal to the value of n ?
A、1
B、2
C、3
D、4

2、Suppose i is a variable of type int, and its value is 10, which of the following is the value of expression 30-i<=i<=9 ?
A、0
B、1
C、9
D、20

3、After the execution of the following statements: int a=0,b=0,m=0,n=0; (m=a==b)||(n=b==a);,the values of m and n are and respectively?
A、0 0
B、1 0
C、0 1
D、1 1

4、Which of the following is equal to the expression !x ?
A、x==1
B、x==0
C、x!=1
D、x!=0

5、Suppose int x=3,y=4,z=5; , which of the following is the value of the expression !(x+y)+z-1 && y+z/2 ?
A、6
B、1
C、2
D、0

6、Which of the following is not a legal expression in C language?
A、0<=x<100
B、x+1=x+1
C、i=j==0
D、(char)(x<100)

7、The expression in if(expression) can be .
A、logical expression
B、any of the above
C、relational expression
D、arithmetic expression

8、When execute the following program: #include <stdio.h> int main() { int x,y; scanf("%d%d",&x,&y); if (x>y) x=y;y=x; else x++;y++; printf("%d,%d",x,y); return 0; } Which one of the following is correct?
A、If input 3 and 4, it outputs 4 and 5
B、Syntax error while compiling
C、If input 4 and 3, it outputs 3 and 4
D、If input 4 and 3, it outputs 4 and 5

9、In C language, the rule on embedded if statement is that else is always paired with .
A、the first if
B、the previous nearest unpaired if
C、if with the same indent
D、the most front if

10、If a=1, b=3, c=5, d=4,the value of x is when execute the following program. if (a<b) if (c<d) x=1 ; else if (a<c) if (b<d) x=2 ; else x=3 ; else x=6 ; else x=7 ;
A、1
B、2
C、3
D、4

11、Which one of the following is equal to the statement y=(x>0 ? 1: x<0 ? -1:0); .
A、y=0; if (x>=0) if (x>0) y=1; else y=-1;
B、if (x>0) y=1; else if (x<0) y=-1; else y=0;
C、if (x) if (x>0) y=1; else if (x<0) y=-1; else y=0;
D、y=-1; if (x) if (x>0) y=1; else if (x==0) y=0; else y=-1;

12、Which one is correct when execute the following code? int x=0,y=0,z=0; if (x=y+z) printf("***"); else printf("###");
A、Syntax error while compiling
B、It outputs ###
C、It outputs ***
D、Error while linking

13、What is the output of the following program? #include <stdio.h> int main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch (y) { case 0 : a++ ; break ; case 1 : b++ ; break ; } case 2: a++; b++; break ; case 3: a++ ; b++ ; } printf("a=%d,b=%d",a,b); return 0; }
A、a=1, b=0
B、a=2, b=1
C、a=1, b=1
D、a=2, b=2

14、If int i=10; the value of i will be after executing the following code. switch (i) { case 9: i+=1 ; case 10: i+=1 ; case 11: i+=1 ; default: i+=1 ; }
A、10
B、13
C、11
D、12

15、Given the declaration: float w; int a, b; , which one of the following is a legal switch statement?
A、switch (w) { case 1.0:printf("*\n"); case 2.0:printf("**\n"); }
B、switch (b) { case 1:printf("*\n"); default:printf("\n"); case 1+2:printf("**\n"); }
C、switch (a); { case 1:printf("*\n"); case 2:printf("**\n"); }
D、switch (a+b); { case 1:printf("*\n"); case 2:printf("**\n"); default:printf("\n"); }

16、If int i=1; the value of i will be after executing the following code. switch (i) { case '1': i+=1 ; case '2': i+=1 ; case '3': i+=1 ; default : i+=1 ; }
A、3
B、2
C、4
D、5

17、After the execution of the following statements: int i=5, j=4, k=6 ; float f; f = (i<j&&j<k)? i : (j<k) ? j : k ; , which one of the following value is equal to the value of f ?
A、5.0
B、4.0
C、6.0
D、7.0

18、After the execution of the following statements: int m1=5,m2=3; m1>m2 ? (m1=1):(m2=-1);, the values of m1 and m2 are respectively?
A、1 and -1
B、1 and 3
C、5 and -1
D、5 and 3

19、switch statements can be totally replaced by if statements at any time.

20、The expression in a case label of a switch statement must be constant expression.

21、The statement if and switch can be embedded.

22、The conditional expression and if statement can be totally replaced by each other.

23、Duplicate case labels aren’t allowed in switch statement.

24、In switch statement, several case can execute the same program segment.

25、The controlling expression in switch statement can be an expression of any type.

26、The case branch in switch statement can be a compound statement or multiply statement sequence.

27、Without break (or some other jump statement) at the end of a case, control will flow into the next case.

Chapter 3 program control structure -5

Quiz 6 Loop Structure

1、What is the output of the following program? #include <stdio.h> int main() { int x=0,y=5,z=3; while(z-->0&&++x<5) y=y-1; printf("%d, %d, %d",x,y,z); return 0; }
A、3, 2, 0
B、3, 2, -1
C、4, 3, -1
D、5, -2, -5

2、Which one of the following contains an infinite loop?
A、for (i=1;;) { if (i++%2==0) continue ; if (i++%3==0) break ; }
B、for (i=1;;) if (++i<10) continue ;
C、i=32767; do { if (i<0) break ; } while (++i) ;
D、i=1 ; while (i--);

3、The following code . x=-1; do{ x=x*x; }while (!x);
A、is an infinite loop
B、loops for 1 time
C、loops for 2 times
D、has syntax error

4、Which one of the following statements is correct?
A、do statement cannot be replaced by the other iteration statements.
B、do statement will be terminated when its controlling expression is zero.
C、do statement can only be terminated by break statement.
D、do statement will be terminated when its controlling expression is non-zero.

5、Assume the following code: int n=0,p; do { scanf("%d",&p); n++; } while (p!=12345 && n<3);When , the loop will terminate.
A、p is not equal to 12345 and n is less than 3
B、p is equal to 12345 or n is not less than 3
C、p is equal to 12345 and n is not less than 3
D、p is not equal to 12345 or n is less than 3

6、Given the following for statement: int i,k; for (i=0,k=-1; k=1 ; i++,k++) printf("***"); Which one of the following conclusions is correct?
A、The above for statement contains illegal expression.
B、The above for statement is an infinite loop.
C、The above for statement loops for 1 time.
D、The above for statement never loops.

7、The loop times of the following for statement are . for (i=2; i==0;) printf("%d",i--);
A、infinite
B、0
C、1
D、2

8、What is the output of the following program? #include <stdio.h> int main() { int i,sum; for(i=1;i<6;i++) sum+=i; printf("%d",sum); return 0; }
A、0
B、unpredictable
C、14
D、15

9、Assume s, a, b, c are declared as integers, and a, c have been assigned values (c>0), s=a; for(b=1; b<=c; b++) s=s+1;Which one of the following is equal to the above code?
A、s=a+b;
B、s=a+c;
C、s=s+c;
D、s=b+c;

10、What is the output of the following program? #include <stdio.h> int main() { int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf("%d",s); return 0; }
A、10
B、It contains an infinite loop and will not output anything.
C、13
D、21

11、If the variables i and p have been declared and initialized correctly, which one of the following cannot calculate 5! ?
A、for(i=1,p=1;i<=5;i++) p*=i;
B、for(i=1;i<=5;i++) { p=1; p*=i; }
C、i=1; p=1; while(i<=5) { p*=i; i++; }
D、i=1; p=1; do{ p*=i; i++; }while(i<=5);

12、In the following programs, which one has the different output with the others’?
A、k=1 while (1) { s+=k ; k=k+1; if (k>100) break ; } printf("%d",s);
B、int k,s=0; for (k=1;k<=100;s+=++k); printf("%d",s);
C、k=1; Repeat : s+=k ; if (++k<=100) goto Repeat printf("%d",s);
D、k=1; do{ s+=k; }while (++k<=100); printf("%d",s);

13、What is the output of the following program? #include <stdio.h> int main() { int k=0,m=0,i,j; for (i=0; i<2; i++) { for (j=0; j<3; j++) k++ ; k-=j ; } m = i+j ; printf("k=%d,m=%d",k,m); return 0; }
A、k=0,m=3
B、k=0,m=5
C、k=1,m=3
D、k=1,m=5

14、Which one of the following is not correct?
A、The statements in C language, except compound statements, must be ended with semicolons.
B、An empty statement does not affect the program in any location.
C、Compound statements are regarded as one single statement in syntax.
D、An assignment statement can be made by adding a semicolon at the end of the assignment expression.

15、Assume the following program fragment: int k=2; while (k=0) { printf("%d",k) ; k-- ; }Which one of the following is correct?
A、while statement loops for 10 times.
B、The loop never runs.
C、The loop is infinite.
D、The loop runs for only one time.

16、while in do statement can be omitted sometimes.

17、Any of the 3 expressions in for loop can be omitted, and so is while and do statement’s controlling expression.

18、The most powerful iteration statement is for statement.

19、The loop body in the for statement will be executed at least once.

20、break can be used in switch statements and loops (while, do, and for), whereas continue is limited to loops.

Chapter 4 The Preprocessor

Quiz 7 Preprocessor

1、Which one of the following statements is wrong?
A、Preprocessing directive must begin with #.
B、A line which begins with # in C program is a preprocessing directive.
C、The preprocessing directives in C program are processed during executing.
D、Preprocessing directives can appear in any line of a C program.

2、Which one of the following statements about macro substitute is wrong ?
A、Macro substitute does not occupy the executing time.
B、Macro name does not have data type.
C、Macros must be named with capital letters.
D、Macro substitution is just string substitution.

3、Assuming we have #define L(x) 2*3.14*x,thus L(x) is .
A、function name
B、function invoking
C、macro with argument
D、macro with no arguments

4、Assuming we have #define P(x) x/x, what is the output after executing printf("%d",P(4+6)); ?
A、1
B、8.5
C、11
D、11.5

5、Assuming the macro definition #define MOD(x,y) x%y, what is the result of the following code? int z,a=15; float b=100; z=MOD(b,a); printf("%d",z++);
A、11
B、10
C、Syntax error
D、6

6、Which one of the following macro for square calculation will not cause ambiguity in any case?
A、#define POWER(x) x*x
B、#define POWER(x) (x)*(x)
C、#define POWER(x) ((x)*(x))
D、#define POWER(x) (x*x)

7、Given a macro definition as follows: #define N 3 #define Y(n) ((N+1)*n), which one of the following is the value of the expression 2*(N+Y(5+1))?
A、error
B、42
C、48
D、54

8、Given a macro definition #define p(x,y,z) x=y*z; the substitution p(a,x+5,y-3.1) will be .
A、a=(x+5)*(y-3.1);
B、a=x+5*y-3.1
C、a=x+5*y-3.1;
D、a=(x+5)*(y-3.1)

9、In the file including preprocessing directives, when the file name is enclosed by double quotes after #include, the file will be searched in .
A、in the standard searching directory of system setting
B、only in the source file directory
C、in the source file directory first, then the standard directory searching of system setting
D、only in the current directory

10、In the file including preprocessing directives, when the file name is enclosed by angle bracket after #include, the file will be searched .
A、in the source file directory first, then the standard directory searching of system setting
B、only in the source file directory
C、in the standard searching directory of system setting
D、only in the current directory

11、Macro substitution does not have type problem, and its arguments are of no type either.

12、In C language standard library header files, many system function prototype are declared. Therefore, as long as these functions are used in the program, these header files should be included, for checking the function calling by compiling system.

13、#include directive can include a C source file with function definition.

14、The header files included by #include must have the suffix .h.

Chapter 5 Array-2

Quiz 8 Arrays

1、When index the array element, which one of the following statements is wrong?
A、The array subscript can be integer constant.
B、The array subscript can be integer expression.
C、The array subscript can be integer constant or integer expression.
D、The array subscript can be expression of any types.

2、Which one of the following declarations can define a one dimensional array a correctly in C89?
A、int a(10);
B、int n=10,a[n];
C、int n; scanf("%d",&n); int a[n];
D、#define SIZE 10 int a[SIZE];

3、Assume a declaration int a[10]; , which one of the following can reference the element in a correctly?
A、a[10]
B、a(5)
C、a[-10]
D、a[3]

4、Which one of the following statements is wrong?
A、In C, the arrays cannot be assigned values integrally in an assignment statement.
B、Array name represents the starting address of this array in the memory, which cannot be changed.
C、The length of an array can be determined by initializer.
D、If the index of an array element exceeds the range pre-defined, system will give an error message “array index out of bounds”, while executing.

5、Assume the declaration int a[3][4]; which one of the following can index the element in a correctly?
A、a[2][4]
B、a[3][3]
C、a[3][4]
D、a[0][0]

6、Assume the declaration int a[3][4]=; which one of the following statements is correct?
A、Only the element a[0][0] is initialized to 0.
B、It is a wrong statement.
C、Each element in a is initialized but not to 0.
D、Each element in a is initialized to 0.

7、If a 2-D array a has m columns, the formula to index the element a[i][j] is .
A、j*m+i
B、i*m+j-1
C、i*m+j+1
D、i*m+j

8、What is the output of the following code? int k,a[3][3]={ 1,2,3,4,5,6,7,8,9}; for (k=0;k<3;k++) printf("%d",a[k][2-k]);
A、3 6 9
B、1 5 9
C、1 4 7
D、3 5 7

9、Which one of the following initialization is correct for the 2-D array a?
A、int a[3][3]={ };
B、int a[2][2]={ 1,2,3,4,5,6};
C、int a[2,3]={ 1,2,3,4,5,6};
D、int a[3][3]={ 1,2,3,4,5,6};

10、Assume the declaration int b[]={ 1,2,[8]=3,4,5,[15]=1,6,7}; the length of array b is .
A、8
B、17
C、uncertain
D、18

Chapter 6 Functions

Quiz 9 Functions

1、Which one of the following statements about function is right?
A、Every function can be called by the other functions, including main function.
B、Every function can be compiled separately.
C、Every function can be run separately.
D、A function can be defined in the function body of another function.

2、Which one of the following statements is right?
A、Function definitions can be nested, but function calls cannot be nested.
B、Function definitions cannot be nested, but function calls can be nested.
C、Both function definitions and function calls cannot be nested.
D、Both function definitions and function calls can be nested

3、Which one of the following function definitions is right?
A、double f(int x,int y) { z=x+y ; return z ; }
B、double f(int x,int y) { double z ; z = x+y ; return z ; }
C、double f(int x,y) { double z=x+y ; return z ; }
D、double f(x,y) { int x, y ; double z ; z=x+y; return z ; }

4、If call a function int f(), which does not contain any return statement, which one of the following conclusions is right?
A、This function does not return any value.
B、This function returns an unpredictable value.
C、This function returns a system default value.
D、This function returns the value 0.

5、Which one of the following determines the return type of a function in C language?
A、The expression type in the return statement
B、The return type specified by function definition
C、The calling function
D、Compiler

6、Which one of the following statements about function return type is wrong?
A、Function return type can be int.
B、Function return type can be array.
C、Function return type can be char.
D、Function return type can be void.

7、Which one of the following statements is wrong?
A、Actual parameter can be a constant, a variable or an expression.
B、Formal parameter can be a constant, a variable or an expression.
C、Formal parameter can be of any type.
D、The data types of formal parameter and actual parameter can be different.

8、Which one of the following is right?
A、A function call must return a value.
B、Actual parameter and formal parameter can have the same name.
C、The data passed in functions cannot be global variables.
D、The calling function and the called function must be in the same file.

9、Given a function definition as follows: void f(char ch, float x ) { ...... } which one of the following function call statements is right?
A、f("abc",3.0);
B、f(32,32);
C、t=f('D',16.5);
D、f('65',2.8);

10、Assume a program defines a function as follows: double f(double a,double b) { return (a+b); } but the definition is written after calling f. Therefore, f should be declared before the calling. Which one of the following prototypes is wrong?
A、double f(double,double);
B、double f(double a,B);
C、double f(double b,double A);
D、double f(double x,double y);

11、Which one of the following statements about function declaration is wrong?
A、If the definition of a function precede its calls, its function declaration is not required.
B、Function prototypes of standard C functions are not required.
C、A function prototype doesn’t have to specify the names of the function’s parameters, as long as their types are present.
D、C99 has adopted the rule that either a declaration or a definition of a function must be present prior to any call of the function.

12、If an array name is used for an actual parameter in a function calling, which one of the following will be delivered to the corresponding formal parameter?
A、the value of the 1st element in the array.
B、the starting address of the array.
C、all the element values in the array
D、the number of the elements in the array.

13、Given the following code in the main function, which one of the following is an incorrect declaration of the formal argument in function f? int a[3][4]; f(a);
A、f(int array[3][4])
B、f(int array[3][])
C、f(int array[][4])
D、f(int array[4][3])

14、Read the following program: int fun1(double a) { return a*=a;} int fun2(double x,double y) { double a=0,b=0; a=fun1(x); b=fun1(y); return (int)(a+b); } if w is a variable of type double, what is the value of w, after executing the statement w=fun2(1.1,2.0);?
A、5.21
B、5.0
C、5
D、0.0

15、Both function definition and function call can be nested.

16、A function must have a return value, otherwise it cannot be defined as a function.

17、Specifying that the return type is void indicates that the function doesn’t return a value.

Chapter 7 Pointers

Quiz 10 Pointers

1、The pointer of a variable indicates the of the variable.
A、value
B、address
C、name
D、a symbol

2、Given int k=2; int*ptr1,*ptr2; and both ptr1 and ptr2 point to the variable k, which one of the following assignments is not correct?
A、k=*ptr1+*ptr2
B、ptr2=k
C、ptr1=ptr2
D、k=*ptr1*(*ptr2)

3、Given int*p,m=5,n; which one of the following statements is right?
A、p=&n; scanf("%d",&p);
B、p=&n; *p=m;
C、p=&n ; scanf("%d",*p);
D、scanf("%d",&n); *p=n ;

4、Given int*p,a=4; and p=&a; in which one of the following, all items indicate addresses?
A、a,p,*&a
B、&a,&*p,p
C、&*a,&a,*p
D、*&p,*p,&a

5、If a pointer p points to a variable x, which one of the following is equal to *&x ?
A、p
B、x
C、&x
D、&*p

6、If the pointer p points to an integer variable x, which one of the following is equal to (*p)++ ?
A、p++
B、x++
C、*(p++)
D、&x++

7、For two pointer variables of the same base type, which one of the following operations cannot be done?
A、<
B、+
C、=
D、-

8、Given the following function and the variable declaration int a=25; which one of the following is the result of the statement print_value(&a); ? void print_value(int *x) { printf("%d",++*x); }
A、23
B、26
C、24
D、25

9、Given char s[10]; which one of the following is not the address of s[1]?
A、s+1
B、s++
C、&s[0]+1
D、&s[1]

10、Given int a[5],*p=a; which one of the following is a correct reference to an element in array a ?
A、*&a[5]
B、*(a+2)
C、a+2
D、*(p+5)

11、Given int a[5],*p=a; which one of the following is a correct reference to the address of an element in array a ?
A、p+5
B、&a[0]
C、*a+1
D、&a+1

12、Given int x[]={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0},*p=x,k; and k is larger than or equal to 0 and less than 10, which one of the following is a wrong reference to the array element x[k]?
A、*(x+k)
B、p+k
C、x[p-x+k]
D、*(&x[k])

13、Given int x[6]={ 2,4,6,8,5,7},*p=x,i; which one of the following code cannot output the 6 elements in array x in order?
A、for(i=0;i<6;i++) printf("%2d",*(p++));
B、for(i=0;i<6;i++) printf("%2d",(*p)++);
C、for(i=0;i<6;i++) printf("%2d",*(p+i));
D、for(i=0;i<6;i++) printf("%2d",*p++);

14、Given int a[2][3]; which one of the following is a correct reference to the address of the element in i-th row and j-th column of array a?
A、*(a[i]+j)
B、a[i]+j
C、(a+i)
D、*(a+j)

15、Given int a=3,b,*p=&a;which one of the following statements doesn’t assign the value 3 to b?
A、b=*&a;
B、b=*a;
C、b=*p;
D、b=a;

16、Given int a[4][5]; which one of the following references is incorrect?
A、*a
B、++a
C、*(*(a+2)+3)
D、&a[2][3]

17、Given int a[2][3],(*p)[3]; p=a; which one of the following references to an element in the array a is correct?
A、(p+1)[0]
B、*(p[1]+1)
C、*(*(p+2)+1)
D、p[1]+2

18、Given int (*p)[4]; which one of the following statements is right?
A、p is a pointer to an integer variable
B、p is a pointer to a 1D array with 4 integer elements
C、p is a name of the pointer array
D、p is declared illegally.

19、The return value of the function char* fun(char *p){ return p; } is .
A、uncertain value
B、the address value in argument p
C、the address of a temporary memory unit
D、the address value of the formal argument

Chapter 8 Strings

Quiz 11 Strings

1、Which one of the following declarations can define a one-dimensional array a correctly?
A、int a[5]={ 0,1,2,3,4,5};
B、char a[]={ 0,1,2,3,4,5};
C、char a={ 'A','B','C'};
D、int a[5]="0123"

2、Assuming char x[]="12345",y[]={ '1','2','3','4','5',''}; which one of the following statements is correct?
A、x is longer than y.
B、The lengths of array x and y are equal.
C、x is shorter than y.
D、Arrays x and y share the same memory area.

3、Which one of the following initializations of the character array s is wrong?
A、char s[5]={ "abc"};
B、char s[5]="abcde";
C、char s[5]={ 'a','b','c'};
D、char s[5]="";

4、Which one of the following character arrays cannot be used as a string?
A、char s[]="happy";
B、char s[5]={ 'h','a','p','p','y'};
C、char s[6]={ 'h','a','p','p','y',''};
D、char s[]={ "happy"};

5、Which is the output of the following code? char c[5]={ 'a','b','','c',''}; printf("%s",c);
A、'a''b'
B、ab
C、ab c
D、abc

6、Given two arrays of character, a and b, which one of the following statements is correct?
A、gets(a,b);
B、scanf("%s%s",a,b);
C、scanf("%s%s",&a,&b);
D、gets("a"); gets("b");

7、Which is the output of the following code? char a[7]="abcdef"; char b[4]="ABC"; strcpy(a,b); printf("%c",a[5]);
A、└┘
B、f
C、\0
D、e

8、Which is the output of the following code? char c[]="\t\b\\\0will\n"; printf("%d",strlen(c));
A、14
B、3
C、9
D、6

9、Which one of the following can be used to test whether the string a is greater than b?
A、if (a>b)
B、if (strcmp(a,b)>0)
C、if (strcmp(a,b))
D、if (strcmp(b,a)>0)

10、The value of the expression strcmp("3.14","3.278") is .
A、float number
B、non-zero integer
C、0
D、character

11、Given the following code: #include <stdio.h> #include <string.h> int main() { char p[]={ 'a','b','c'}, q[10]={ 'a','b','c'}; printf("%d %d", strlen(p), strlen(q)); return 0; } Which one of the following statements is true?
A、When initializing arrays p and q, the system will add the string terminator automatically, so the output lengths are both 3.
B、The value of strlen(p) is uncertain since p doesn’t have the string terminator, but the string length in array q is 3.
C、The value of strlen(q) is uncertain since q doesn’t have the string terminator, but the string length in array p is 3.
D、Neither of the lengths of arrays p and q can be determined since they are without the string terminators.

12、Which is the output of the following code? char w[][10]={ "ABCD","EFGH","IJKL","MNOP"} , k; for(k=1;k<3;k++) printf("%s",w[k]);
A、ABCDFGHKL
B、EFGHIJKL
C、ABCDEFGIJM
D、EFGJKO

13、If the function fun is defined as: void fun(char ch[], float x) { …… }, which one of the following function call statements is correct for function fun?
A、t=fun('D',16.5);
B、fun("abc",3.0);
C、fun('65',2.8);
D、fun(32,32);

14、Which one of the following statements about character array is wrong?
A、Character arrays can store strings.
B、The character arrays can be assigned values integrally in an assignment statement.
C、The strings can be input/output integrally.
D、The strings in the character array cannot be compared by relational operator.

15、Which one of the following is correct?
A、char *a="china"; is equivalent to char *a; *a="china" ;
B、char *s="china"; is equivalent to char *s; s="china" ;
C、char str[10]={ "china"}; is equivalent to char str[10]; str[]={ "china";}
D、char c[4]="abc",d[4]="abc"; is equivalent to char c[4]=d[4]="abc" ;

16、Which one of the following statement(s) is a correct for the string s?
A、char s[5]={ 'A','B','C','D','E'} ;
B、char s[6]="ABCDE";
C、char s[6] ; s="ABCDE";
D、char *s; scanf("%s",s);

17、Given char s[]="china"; char *p ; p=s ; which one of the following is correct?
A、s and p are exactly equivalent.
B、*p is equal to s[0].
C、The content of array s and pointer p is the same.
D、The length of array s and the length of the string pointed by p are the same.

18、Given char a[]="Itismine", *p="Itismine"; which one of the following is incorrect?
A、a+1 is the address of character ‘t’
B、p cannot point to another constant string variable
C、The address in variable p is changeable.
D、The array a occupies 9 bytes.

19、Given char *cc[2]={ "1234","5678"}; which one of the following is correct?
A、The two elements in array cc store the starting addresses of two 1D character arrays with 4 characters respectively.
B、The two elements in array cc store the starting addresses of the strings "1234" and "5678" respectively.
C、cc is a pointer variable which points to a 1D string array with 2 elements.
D、The elements in the array cc are "1234" and "5678" respectively.

20、Assume s1 and s2 are declared correctly, if we want to execute the statement S when string s1 is greater than s2, which one of the following statements is correct?
A、if(s1>s2)S;
B、if(strcmp(s1,s2)>0)S;
C、if(strcmp(s1,s2))S;
D、if(strcmp(s2,s1)>0)S;

21、Given char s1[]="string1",s2[8],*s3,*s4="string2"; which one of the following is incorrect for library function strcpy?
A、strcpy(s1,s4);
B、strcpy(s3,"string1");
C、strcpy(s2,"string1");
D、strcpy(s2,s1);

Chapter 9 Structures

Quiz 12 Structures, Union and Enumerations

1、Given a structure definition as follows: struct stu { int a; float b; } stutype; , which one of the following statements is wrong?
A、struct is a keyword which is used to declare a structure tag
B、stutype is a user-defined structure type name
C、struct stu is a user-defined structure type
D、a and b are structure members

2、For which one of the following definitions, the compiler will not allocate memory locations.
A、struct { char name[10] ; int age ; } student ;
B、struct STUDENT { char name[10] ; int age ; } ;
C、struct STUDENT { char name[10] ; int age ; } student ;
D、struct STUDENT { char name[10] ; int age ; } ; struct STUDENT student;

3、Which one of the following definitions of the structure variable td1 is wrong?
A、#define AA struct aa AA { int n; float m; } td1;
B、struct { int n; float m; } aa; stuct aa td1;
C、struct { int n; float m; } td1;
D、typedef struct aa { int n; float m; } AA; AA td1;

4、When declare a structure variable, the size of space allocated by system is .
A、the size of space required by the first member in the structure variable
B、the sum of the space size required by each member in the structure variable
C、the memory size of the member which requires the largest space in the
D、the size of memory required by the last member in the structure variable

5、Given the declaration of a structure tag named student as follows: struct student { int no ; char name[20]; char sex; struct { int year; int month ; int day ; } birth; } s; if the member birth of the structure variable s is October 1, 2016. Which one of the following assignments is right?
A、year=2016; month=10; day=1;
B、s.birth.year=2016; s.birth.month=10; s.birth.day=1;
C、birth.year=2016; birth.month=10; birth.day=1;
D、s.year=2016; s.month=10; s.day=1;

6、Given the following code, which one of the following statements can output the letter M. struct person { char name[9]; int age; }; struct person class[10]={ "Johu",17,"Paul",19,"Mary",18,"Adam",16};
A、printf("%c",class[3].name);
B、printf("%c",class[2].name[0]);
C、printf("%c",class[3].name[1]);
D、printf("%c",class[2].name[1]);

7、Which one of the following reference to a member of structure is not right? struct pupil { char name[20]; int age; int sex; } pup[5], *p=pup;
A、scanf("%s",pup[0].name);
B、scanf("%d",p->age);
C、scanf("%d",&pup[0].age);
D、scanf("%d",&(p->sex));

8、Which one of the following reference is not right? struct s { int i1; struct s *i2,*i0; }; static struct s a[3]={ 2,&a[1],0,4,&a[2],&a[0],6,0,&a[1]}, *ptr=a;
A、ptr->i1++
B、*ptr->i1
C、*ptr->i2
D、++ptr->i0

9、Given the following declaration: struct sk { int a; float b; } data; int *p; which one of the following assignments is right, to make p point to a in data?
A、p=&a;
B、p=&data.a;
C、p=data.a;
D、*p=data.a;

10、Given the declaration: struct{ int a; char b;} Q,*p=&Q; which one of the following expression is wrong?
A、(*p).b
B、*p.b
C、Q.a
D、p->a

11、Given the following code: struct st { int x; int *y; } *pt; int a[]={ 1,2},b[]={ 3,4}; struct st c[2]={ 10,a,20,b}; pt=c; which one of the following expressions has the value of 11?
A、*pt->y
B、++pt->x
C、pt->x
D、(pt++)->x

12、Which one of the following statements about union is right?
A、A union type cannot contain a member of array.
B、A union variable cannot store all its members at the same time.
C、A union variable can store all its members at the same time.
D、A union type cannot contain a member of type structure.

13、When declare a union variable, the size of space allocated by the compiler is .
A、the sum of the space size required by each member in the union variable
B、the memory size of the member which requires the largest space in the union variable
C、the size of space required by the first member in the union variable
D、the size of memory required by the last member in the union variable

14、Given the following program: union { char a[10]; short b[4][5]; long c[5]; } u; the value of sizeof(u) is .
A、10
B、40
C、20
D、70

15、Given the following program: union data { char ch; int x; } a; which one of the following is not right?
A、a.x=10;a.x++;
B、a={ 'x',10}
C、a.ch='x';a.ch++;
D、a.x=10;a.ch='x';

16、Given the following declaration: enum color { red,yellow=2,blue,white,black} r=white; what is the output after executing the statement printf("%d",r); ?
A、0
B、4
C、1
D、3

17、Given the following declaration: enum week { sun, mon, tue, wed, thu, fri, sat} day; which one of the following assignments is right?
A、sun=0;
B、day=sun;
C、sun=day;
D、mon=sun+1;

18、Which one of the following statements is wrong?
A、All elements in union variable have the same beginning address.
B、A member in a union type can be of type structure, but not of type union.
C、A union type can be used to declare array and pointers.
D、If use typedef to give an old type a new identifier, after that, the old type is still valid.

19、Given the following statement: typedef struct { int n;char ch[8];} PER; which one of the following statements is right?
A、PER is a structure variable name
B、PER is a structure type name
C、typedef struct is a structure type
D、struct is a structure tag

Chapter 10 Files

Quiz 13 Files

1、Which one of the following is correct about data file and C language?
A、Files consist of ASCII character sequence and C language can only read and write text files.
B、Files consist of binary data sequence and C language can only read and write binary files.
C、Files consist of records sequence and can be categorized into binary files and text files by the storage form of the data.
D、Files consist of data streams and can be categorized into binary files and text files by the storage form of the data.

2、The system standard input file is .
A、monitor
B、floppy disk
C、hard disk
D、keyboard

3、The system standard output file is .
A、hard disk
B、keyboard
C、floppy disk
D、monitor

4、Which one of the following is a correct file name argument for the function fopen?
A、c:\user\text.txt
B、c:\\user\\text.txt
C、"c:\user\text.txt"
D、"c:\\user\\text.txt"

5、Given char fname[]="infile.dat"; , which one of the following is a correct way to open the text file infile.dat for reading?
A、fopen(infile,"r")
B、fopen("infile","r")
C、fopen("fname","r")
D、fopen(fname,"r")

6、Which one of the following is a correct way to create a file for both reading and writing using the function fopen ?
A、"ab+"
B、"rb+"
C、"ab"
D、"wb+"

7、If errors occur while executing the function fopen, what is its return value?
A、the address
B、1
C、EOF
D、NULL

8、If open an existing file using the argument "a+", which one of the following is correct?
A、When it is open, the origin file content remains, the accessing pointer moves to the beginning of the file and rewriting/reading operations are available.
B、When it is open, the origin file content is deleted, only reading operation is available.
C、None of the above is correct.
D、When it is open, the origin file content remains, the accessing pointer moves to the end of the file and appending/reading operations are available.

9、In the file open modes, the string "rb" indicates .
A、opening a text file only for data writing.
B、opening an existing text file only for data reading.
C、opening a binary file only for data writing.
D、opening an existing binary file only for data reading.

10、When opening the text file "a:\\aa.dat" in the mode "w", if the file already exists, .
A、the new data will be appended to the end of the file.
B、the error message will be displayed.
C、the new data will be insert into the beginning of the file.
D、the file will be clear and the new data is written from the beginning.

11、In C program, which one of the following can write an integer data into a file in binary form?
A、fprint
B、fputs
C、fputc
D、fwrite

12、Which one is the prototype of the function fputc that write a character to the disk files?
A、FILE* fputc(char)
B、int fputc(FILE *)
C、int fputc(FILE *,char)
D、int fputc(char,FILE *)

13、Which one of the following operations can be done using the function fseek?
A、sequential file access
B、random file access
C、all of the above
D、changing the file position associated with the file pointer.

14、The function calling fseek(fp,-20L,SEEK_END) complete the operation .
A、moving the file pointer to the location 20 bytes to the file header.
B、moving the file pointer 20 bytes forward from the current location.
C、moving the file pointer 20 bytes backward from the current location.
D、moving the file pointer 20 bytes backward from the end of the file.

15、Which one of the following codes is nearly equal to fseek(fp,0L,SEEK_SET)?
A、feof(fp)
B、ftell(fp)
C、fgetc(fp)
D、rewind(fp)

16、The function rewind can .
A、move the file pointer to the specific location of the file.
B、move the file pointer to the end of the file.
C、move the file pointer to the location of the next character.
D、move the file pointer to the beginning of the file.

17、The function ftell(fp) can .
A、move the pointer of the stream file.
B、initialize the pointer of the stream file.
C、all the above.
D、get the current location of the stream file.

Final Examination

Part1-Objective questions

1、Which of the following is a legal C identifier?
A、99NPU
B、abc@NPU
C、my_NPU
D、your-NPU

2、In C language, which of the following operator requires its operands must be of type int?
A、/
B、*
C、%
D、=

3、The following code . a=-1; do{ a=a*a; }while (!a);
A、is an infinite loop
B、loops for 2 times
C、loops for 1 time
D、has syntax error

4、Suppose int x=3,y=4,z=5; , which of the following is the value of the expression !(x+y)+z-1 && y+z/2 ?
A、6
B、2
C、1
D、0

5、Suppose that we call scanf as follows: scanf(“%f%d%f”, &a, &c, &b); If the user enters: 12.3 45.6 321 What will be the values of a, c, and b after the call? (Assume that a and b are double variables and c is an int variable.)
A、12.3 45 321
B、12.3 45.6 321
C、12.3 45 0.6
D、12 45 321

6、If c is a variable of type char, which one of the following statements is illegal?
A、i += c; /*i has type int*/
B、c = 2*c – 1;
C、putchar(c);
D、printf(c);

7、What is the output of the following code? int a; char c=10; float f=100.0; double x; a=f/=c*=(x=6.5); printf("%d %d %3.1f %3.1f",a,c,f,x);
A、1 65 1 6.5
B、1 65 1.0 6.5
C、2 65 1.5 6.5
D、1 65 1.5 6.5

8、Execute the following statements, if input 87654321↙,what is the output? int a , b ; scanf("%2d%*2d%3d",&a,&b); printf("%d",a+b);
A、46
B、579
C、Error
D、519

9、After the execution of the following statements: int a=1, b=2, c=3, d=4, t1=2, t2=2, k; k = (t1=a>b) && (t2=c>d); , which one of the following value is equal to the value of t2 ?
A、1
B、2
C、3
D、4

10、Suppose int a=3,b=4,c=5; , which of the following is the value of the expression !(a+b)+c-1 && b+c/2 ?
A、6
B、1
C、2
D、0

11、Assume a declaration int t[10]; , which one of the following can reference the element in t correctly?
A、t[10]
B、t(5)
C、t[-10]
D、t[3]

12、Assume the declaration int b[]={ 1,2,[8]=3,4,5,[15]=1,6,7,9}; the length of array b is .
A、8
B、15
C、19
D、uncertain

13、What is the output of the following code? int k,a[3][3]={ 3,2,3,3,5,6,7,3,9}; for (k=0;k<3;k++) printf("%d",a[k][2-k]);
A、3 6 9
B、3 5 9
C、3 2 3
D、3 5 7

14、Given a structure definition as follows: struct mystr { int a; float b; } mytype; , which one of the following statements is wrong?
A、struct is a keyword which is used to declare a structure tag
B、mytype is a user-defined structure type name
C、struct mystr is a user-defined structure type
D、a and b are structure members

15、Which is the output of the following code? char w[][10]={ "ABCD","EFGH","IJKL","MNOP"} , k; for(k=1;k<3;k++) printf("%s",w[k]);
A、ABCDFGHKL
B、EFGHIJKL
C、ABCDEFGIJM
D、EFGJKO

16、The loop body in the for statement will be executed at least once.

17、Without break (or some other jump statement) at the end of a case, control will flow into the next case.

18、In switch statement, several case can execute the same program segment.

19、The expression in a case label of a switch statement must be constant expression.

20、The three identifiers, wendy, Wendy and WENDY, are equal in C language.

Part2-Subjective questions

1、Lao Wang sold apples in n days (n < = 5). For example, n is five days. On the first day, he sold half of all the apples plus half an apple; The next day, he sold one third of the remaining apples plus one third of an apple; On the third day, he sold 1/4 of the remaining apples plus 1/4 of an apple; On the fourth day, he sold 1/5 of the remaining apples and 1/5 of an apple, and on the last day, he sold the remaining 11 apples. Input n and output the number of apples at the beginning (you can't cut the apples when you sell them). The intput is an integer which is no more than 5 The output is an integer. We will test 5 kinds of data. Your will get all the scores if your code pass 5 times of judge. Submit your porgram here.

2、Please describe the functions of the arrays, such as when or why should we use arrays, what problems we can solve with arrays, etc.

3、According to your answer above, design a programming question about the arrays, and write the program with comments. So , you shoulde write: Your question about the arrays Your code (your program) with comments

4、Please describe the functions of the pointers, such as when or why should we use pointers, what problems we can solve with pointers, etc.

5、According to your answer above, design a programming question about the pointers, and write the program with comments. So , you shoulde write: 1. Your question about the pointers. 2. Your code (your program) with comments

学习通Fundamentals of C Programming_1

在计算机科学与技术领域中,使用C语言编程是一项非常基础的技能。因此,为了提高自己的编程能力和理解计算机底层原理,我选择了学习学习通中的“Fundamentals of C Programming_1”课程。

课程概述

本课程是一门C语言编程的入门课程,内容涵盖了C语言的基本语法、数据类型、运算符、选择结构、循环结构、函数等方面的知识。通过课程学习,学生可以了解C语言的基本概念和编程方法,并能够使用C语言编写简单的程序。同时,学生还可以通过本课程掌握一定的计算机底层原理,如内存管理、指针操作等。

课程特点

本课程的特点主要体现在以下几个方面:

  • 由C语言专业人士授课,讲解详细、深入。
  • 采用了一定的理论与实践相结合的教学方式,使学生可以较好地理解所学内容。
  • 附有大量的编程习题和实践案例,可以帮助学生巩固所学知识和提高编程水平。
  • 视频课程和文字教材相结合,可供学生根据自身情况选择学习方式。

课程内容

本课程共分为十个章节,每个章节的内容如下:

第一章 C语言概述

本章主要介绍C语言的历史、特点以及C语言编程的基本流程。

第二章 C语言基本语法

本章主要介绍C语言中的关键字、标识符、注释、数据类型等基本语法。

第三章 运算符

本章主要介绍C语言中的算术运算符、逻辑运算符、关系运算符等运算符的使用方法。

第四章 选择结构

本章主要介绍C语言中的if语句、switch语句等选择结构的使用方法。

第五章 循环结构

本章主要介绍C语言中的while循环、do-while循环、for循环等循环结构的使用方法。

第六章 数组

本章主要介绍C语言中的一维数组、二维数组等数组的定义、初始化以及访问方法。

第七章 指针

本章主要介绍C语言中指针的定义、运算符、使用等基本概念。

第八章 函数

本章主要介绍C语言中函数的定义、调用、参数传递等方面的知识。

第九章 文件操作

本章主要介绍C语言中文件操作的基本方法,包括文件的打开、读写、关闭等操作。

第十章 综合实例

本章主要通过一个综合实例,让学生综合应用所学知识,编写一个完整的C语言程序。

课程评价

对于没有编程基础的初学者来说,本课程是一门非常好的入门课程。课程内容详细、深入,配合大量习题和实践案例,可以帮助学生循序渐进地提高编程水平。同时,本课程的理论与实践结合也使学生能够更好地理解所学内容。对于已经有一定编程基础的学生来说,本课程也可以作为一份很好的复习材料,加深对C语言编程的理解和掌握。

总结

学习通的“Fundamentals of C Programming_1”课程是一门非常优秀的C语言编程入门课程。课程内容详细、深入,理论与实践相结合,适合初学者和复习者使用。通过学习本课程,学生可以掌握C语言编程的基础知识,为进一步学习计算机科学与技术领域相关课程打下坚实的基础。

学习通Fundamentals of C Programming_1

在计算机科学与技术领域中,使用C语言编程是一项非常基础的技能。因此,为了提高自己的编程能力和理解计算机底层原理,我选择了学习学习通中的“Fundamentals of C Programming_1”课程。

课程概述

本课程是一门C语言编程的入门课程,内容涵盖了C语言的基本语法、数据类型、运算符、选择结构、循环结构、函数等方面的知识。通过课程学习,学生可以了解C语言的基本概念和编程方法,并能够使用C语言编写简单的程序。同时,学生还可以通过本课程掌握一定的计算机底层原理,如内存管理、指针操作等。

课程特点

本课程的特点主要体现在以下几个方面:

  • 由C语言专业人士授课,讲解详细、深入。
  • 采用了一定的理论与实践相结合的教学方式,使学生可以较好地理解所学内容。
  • 附有大量的编程习题和实践案例,可以帮助学生巩固所学知识和提高编程水平。
  • 视频课程和文字教材相结合,可供学生根据自身情况选择学习方式。

课程内容

本课程共分为十个章节,每个章节的内容如下:

第一章 C语言概述

本章主要介绍C语言的历史、特点以及C语言编程的基本流程。

第二章 C语言基本语法

本章主要介绍C语言中的关键字、标识符、注释、数据类型等基本语法。

第三章 运算符

本章主要介绍C语言中的算术运算符、逻辑运算符、关系运算符等运算符的使用方法。

第四章 选择结构

本章主要介绍C语言中的if语句、switch语句等选择结构的使用方法。

第五章 循环结构

本章主要介绍C语言中的while循环、do-while循环、for循环等循环结构的使用方法。

第六章 数组

本章主要介绍C语言中的一维数组、二维数组等数组的定义、初始化以及访问方法。

第七章 指针

本章主要介绍C语言中指针的定义、运算符、使用等基本概念。

第八章 函数

本章主要介绍C语言中函数的定义、调用、参数传递等方面的知识。

第九章 文件操作

本章主要介绍C语言中文件操作的基本方法,包括文件的打开、读写、关闭等操作。

第十章 综合实例

本章主要通过一个综合实例,让学生综合应用所学知识,编写一个完整的C语言程序。

课程评价

对于没有编程基础的初学者来说,本课程是一门非常好的入门课程。课程内容详细、深入,配合大量习题和实践案例,可以帮助学生循序渐进地提高编程水平。同时,本课程的理论与实践结合也使学生能够更好地理解所学内容。对于已经有一定编程基础的学生来说,本课程也可以作为一份很好的复习材料,加深对C语言编程的理解和掌握。

总结

学习通的“Fundamentals of C Programming_1”课程是一门非常优秀的C语言编程入门课程。课程内容详细、深入,理论与实践相结合,适合初学者和复习者使用。通过学习本课程,学生可以掌握C语言编程的基础知识,为进一步学习计算机科学与技术领域相关课程打下坚实的基础。