当前位置:文档之家› c语言题库(判断)河南工业大学 河工大 c语言期末考试题库(C language question

c语言题库(判断)河南工业大学 河工大 c语言期末考试题库(C language question

c语言题库(判断)河南工业大学河工大 c语言期末考试题库(C language question bank (judgment), Henan University of Technology C language final examination questions bank)~~~1All the operations of a computer are controlled by the program. Without the program, the computer will accomplish nothing.~y~~~1A program is a set of instructions that a computer can recognize and execute.~y~~~1Since computers can recognize and accept machine instructions directly, machine language is the most suitable language for people to program.~n~~~1A compiler can convert programs written in high-level language into machine instructions.~~~1In general, we refer to programs written in high-level languages as object programs.~n~~~1Before you can generate executable programs, you should compile and connect again.~y~~~1The reason for high-level language is that it can be written in a program that does not follow any form.~n~~~1C programming language freedom is large, so it belongs to unstructured language.~n~~~1The C language is a high-level language that does not allow direct access to physical addresses.~n~~~1Functions are a major part of a C program.~y~~~3If you use the TC2.0 compiler, the compilation system is assigned 2, 1, and 4 bytes to int, char, and float~y~~~3The following are valid variable names: day, sum, and _pint~y~~~3If char c is defined, then c= "C"";~n~~~3The C language can use a symbolic name to represent a constant~y~~~3The following procedures segment float x=3.6; int i; i= (int) x; then x=3, i=3~n~~~3In the C language, character data can be arithmetic operations with integer data~y~~~3The accuracy can be specified when using scanf to enter data~n~~~3In C (+, -) operator can only be used for variable~y~~~3The float a=b=c=1.0 is correct in the C language~n~~~3In putchar (c), C can be an escape character~y~~~4The if statement, whether written on a few lines, is a whole and belongs to the same statement.~y~~~4The entire if statement can be written on multiple lines or written on a single line.~y~~~4In the if statement, if must have else.~~~4In the if statement, else must have if.~y~~~4The else clause cannot be used alone as a statement, and must be paired with if.~y~~~4In the C language compiling system, when the result of logical operations is expressed, the value "1" stands for "truth", and "0" means "false"".~y~~~4Arithmetic operators have precedence over relational operators.~y~~~4Logic is not the highest priority in logical operators.~y~~~4The switch statement is a multi branch selection statement.~y~~~4In judging whether a quantity is true, 0 represents "false", and "0" stands for "true"".~y~~~5In the C language, 3 statements that implement the loop structure are the for statement, the while statement, and the DO-WHILE statement.~y~~~5For ((.)) and while (1) are infinite loops.~y~~~5In C, the while statements that implement loop structures are exactly equivalent to the DO-WHILE statements.~n~~~5The execution statement for (i=1; i++<4;); the value of the latter variable I is 4~n~~~5The for statement can only be used in cases where the number of cycles has been determined.~n~~~5The existing definition of int k=1; executes the statement while (++k<4); then, the value of K is 4~y.~~~5#include <stdio.h> int (main) program j=10, i=0 {int, k=2, s=0; for (;;) {i+=k; if (i>j) {printf (%d, s); break;}s+=i;}}, judge i>j carried out 6.~y~~~5Int s=36; while (s) --s; constitutes a dead loop.~n~~~5Program segment int =0; while (t=1) {printf ("%d\n", "t");} at run time, the printf statement executes 0 times.~n~~~5Program #include, <stdio.h>, int, main (), {int, x=23;. Do {printf ("%d", "x--"); "while" ("X");} the output of the runtime is 23~y~~~6When defining an array, an array subscript can be represented by a variable~n~~~6When referencing elements in an array, the array subscript can be represented by a variable~y~~~6Int a[8]; defines an integer array; the last element in the array is a[8]~n~~~6Int a[6]; defines an integer array; the first element in the array is a[1]~n~~~6Int a[2][3]; defines an array in which there are 6 elements in the array~y~~~6Suppose that s[10] is an array of characters, by scanf ("%d", "s"); you can enter a string to the array~y~~~6Int a[6]={0}; defines an array a, and the initial value of each element in the array is 0~y~~~6Int, a[2][3]={{1}, {2}, {3}}; the correct method of initial values for an array~y~~~6Compare the size of two strings, and you can use the strcpy function~n~~~6To connect two strings, you can use the strcat function~y~~~6To test the length of a string, you can use the strlen function~y~~~7If the definition of the call function appears before the main function, you do not have to declare it.~y~~~7The C language cannot define functions nested, nor can nested functions be called. That is to say, no function can be called in the process of invoking a function~n~~~7The variables defined in the primary function are also valid only in the primary function, not in the entire file or program because they are defined in the main function. The main function cannot use variables defined in other functions.~~~7Variables in different functions can use the same name. They represent different objects and do not interfere with each other.~y~~~7Within a function, variables can be defined in compound statements, which are valid only in the compound statement, which is also called a sub program or a block of programs".~y~~~7The variables defined in a function are external variables, and variables defined outside the function are called local variables, and the external variables are global variables (also known as whole variables).~n~~~7Local variables can be shared by other functions in this document. Its range of validity starts from the location of thedefined variable to the end of the source file.~n~~~7It can be divided into static storage mode and dynamic storage mode from the point of view of the existence of variable value.~y~~~7The so-called dynamic storage means when the program is running, the system allocates a fixed storage space.~n~~~7Static storage is the way to dynamically allocate storage space as needed during program execution.~n~~~7In C, if a pointer variable is used to call an argument, the pointer variable is determined, pointing to a defined cell.~y~~~7In the C language, the call of a function can only get a return value, and the pointer can be used as a function parameter to obtain multiple values.~y~~~7In C language, input and output statements are used to input and output data.~n~~~7When using the putchar function, you must include the header file stdio.h before.~y~~~7Using the putchar function, you can output a string to the terminal.~n~~~7Using the printf function, you can output by a certain number of digits.~y~~~7In the printf function, both%c and%s can output strings.~n~~~7When you enter data into a defined variable with the scanf function, you must add &.~y~~~7When data is entered into a defined variable using the scanf function, the data input ends when an illegal input is entered.~y~~~7The use of input and output functions, putchar (getchar ()), statements are wrong (correct).~~~8The pointer to the array element is the address of the index group element.~y~~~8The program for exchanging two pointer variables P1 and P2 is temp=*p1; *p1=*p2; *p2=temp;~n~~~8Printf ("%d", "a[i]") plays the same role as printf ("%d", "*" (a+i)), and the former is efficient.~n~~~8The array name of the parameter is not a national address, but is handled by pointer variables.~y~~~8The pointer to the function that defines the format is int *p (int, int);.~n~~~8The program segments int, *p, a=2; p=&a; printf ("%d", * (p++)); the output is 2~y.~~~8In C99, you can define pointer variables of the base type of void, which can point to any type of variable.~n~~~8The program segment that points P to the string "China" is char *p; p= "China"";~y~~~8Program segments are int, a, m=4, n=6, *p1=&m, *p2=&n, a= (*p1) / (*p2) +5; after execution, the value of a is 5~y~~~8Void f (int *n) {while ((*n) - (printf); "%d" + + (*n));} (main) {int a=1; f (&a);} no output~n~~~9The C language allows users to build their own composite data structures composed of different types of data, called structures.~y~~~9The name of the struct type is the name of the struct.~n~~~9When defining a struct, the type of a member must be specified, either as a simple data type or as a constructed data type.~y~~~9If the program contains the struct type, the name of the struct member cannot be the same as the variable name in the program.~n~~~9Members of structural variables can perform various operations just like normal variables.~y~~~9Each element of an array in an array of structures is of the same type, and can perform input and output operations on each array element as a whole.~n~~~10The file identifier contains three parts,File path, file name, trunk, and file suffix. The naming rule of a file name follows the naming rule of an identifier. The suffix is used to represent the nature of a file, consisting of 3 letters.~~~10According to the organization of data, data files are divided into ASC|| files (text files) and binary files (image files), and ASC|| files save storage space than binary files.~n~~~10In the buffer file system, each using the file has a corresponding file information in memory, and the file associated with the file pointer to the file information and it also points to an external data on the media file.~n~~~10The pointer variable of a file type data is a pointer to a structure named FILE.~y~~~10Open a file in'w'. If the file already exists, the system empties the contents of the file while opening the file and waits for the new data to be written.~y。

相关主题