Unit 6 C programming Flashcards
1
Q
include <stdio.h></stdio.h>
Let’s say
int main()
{
printf(“Hello World”);
return 0
}
What is the run order of this program
A
- The C program runs in user mode
- The Program invokes printf()
- The C library intercepts this call and invokes the WriteFile() system call
- A system call is a request to the operating system to do something
- During the execution of a system call the mode is changed from user mode to kernel mode
- The library takes the value returned and passes it back to the program
2
Q
What are the three basic functions that take place in every C program
A
- Accepting of data as input
- Processing of data
- Generating output
3
Q
What is the keyboard input stream called
A
stdin
4
Q
What is the output stream
A
stdout
5
Q
What is the formatted input function
A
scanf()
6
Q
What is the formatted output function
A
printf()
7
Q
What are the unformatted input functions
A
getchar()
gets()
8
Q
What are the unformatted output functions
A
putchar()
puts()
9
Q
How would you read an integer from stdin
A
include main <stdio.h></stdio.h>
int main() {
int inputFromUser;
scanf(“%d”, &inputFromUser);
return 0;
}