1.What C loop type is described as pre-test conditional? 2.Define the term inter
ID: 3535718 • Letter: 1
Question
1.What C loop type is described as pre-test conditional?
2.Define the term interation.
3.What does a finction prototype tell the complier?
4.Does a function prototype come before or after main in a C
program?
5.Why might a programmer create a user function?
6.Why might you create and use files in your program?
7.What statement in C is used to open a file?
8.Write a single C statement that will create a FILE structure
variable named out. Assume that all other needed code is
present.
9. Write the single C statemen that will open a file named
myfile.txt for output. Use the FILE variable out. Assume that all
other coded needed is present.
10.What C statement is used to close a file?
11.Write the single C statement that will close a file opened
using FILE variable named out.
12.If you want to read strings of text from a file would it be
better to use fscanf() or fgets()?
13.What is an array?
14.A string is an array of char that is NULL terminate. Decribe
or define NULL.
15.Write the single line of code needed to define a single
dimension array of integers name myarray.The array should have five
elements. Assume that all other code needed is present.
16.If you have a five element array of integers, what is the
number (index) of the first element?
17.If you have a five element array of integers, what is the
number(index) of the last element?
18.An int array was defined as int thisarray[20]; Write a single
line of code that will assign the value 10 to the second element in
the array. Assume all oter code needed is present.
19.Does C permit an array to be used as a parameter if a user
function?
20.Define structure as used in C.
21.Define array bounds checking.
Explanation / Answer
1.The loop in which first condition is checked and then body of loop is executed,is called pretest loop.
2.Iteration is the repetition of a function or process in a computer program.
3.The prototype tells the compiler what the function will return, what the function will be called, as well as what arguments the function can be passed.
4.Before
5.If you have a special set of instructions that aren’t in a built-in function, you can create a user-defined function.
7.fopen() Syntax: FILE * fopen(char * filename, char * mode)
8. FILE * hFile;
9.FILE * hFile;hFile = fopen( myfile.txt, "r");
10. fclose
11.fclose(hFile);
12 fgets()
13 An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index
14.The null character (also null terminator), abbreviated NUL, is a control character with the value zero. It is present in many character sets, including ISO/IEC 646 (or ASCII), the C0 control code, the Universal Character Set (or Unicode), and EBCDIC. It is available in nearly all mainstream programming languages.
15. int myarray[5];
16. 0
17. 4
18. thisarray[1]=10;
19.A struct in C programming language is a structured (record) type that aggregates a fixed set of labelled objects, possibly of different types, into a single object.
20.Array bounds checking is any method of detecting whether a array is within some bounds before the next element in array is intialized
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.