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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the keyboard input stream called

A

stdin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the output stream

A

stdout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the formatted input function

A

scanf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the formatted output function

A

printf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the unformatted input functions

A

getchar()
gets()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the unformatted output functions

A

putchar()
puts()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly