1Why is memory volatile?
Its contents are lost once the program is terminated.
2What is a file used for in programming?
To store data that can be later retrieved and displayed either in part or in whole.
3What are the main file operations in C?
Creation, writing, opening, reading, and closing a file.
4Which function is used to write strings to a file in C?
fputs()
5Which function is used to open a file in C?
fopen()
6What are the three tasks fopen() performs when opening a file?
Searches the disk, loads the file into a buffer, and sets up a character pointer.
7Which function is used to close a file in C?
fclose()
8Which function reads characters from a file in C?
fgetc()
9What does fgetc() return when the end of a file is reached?
EOF (End of File)
10What file mode allows reading and writing but not modifying existing content?
"a+"
Function Libraries Flashcards:
---
11What is a library function in C?
A built-in function grouped together in a common location called a library.
12How are header files included in a C program?
Using the syntax #include<filename.h>.
13Which header file contains input/output functions in C?
stdio.h
14Which header file contains string-related functions in C?
string.h
15Which header file contains common functions for C programs?
stdlib.h
16Which function is used to print values to the screen in C?
printf()
17Which function is used to read data from the keyboard in C?
scanf()
18Which function writes an integer to a file in C?
putw()
19What does the pow() function do in C?
Returns x raised to the power of y.
20What does the sqrt() function do in C?
Returns the square root of a number.
21Which function checks if a character is alphanumeric in C?
isalnum()
22Which function converts uppercase letters to lowercase in C?
tolower()
23Which function allocates requested memory in C?
malloc()
24What does the exit() function do in C?
Causes the program to terminate normally.
Let me know if you'd like more flashcards or further adjustments!