Chapter 6 Flashcards

1
Q

What are some common functions from previous chapters?

A
Pow (a,b)
Time(0)
Rand()
Srand()
Main ()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the syntax of a function

A

ReturnValueType functionName (list of parameters)

{ 
// function body
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the function header specify?

A

The functions return value type, function name, and parameters

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

In a function where you want to preform operations without returning a value what’s is the return valueValueType?

A

Void

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

A function that returns a value is called a ______ _______ function

A

Value returning

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

A function that does not return a value is called a _____ function

A

Void

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

Function exits a statement when…..?

A

A return statement is executed

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

In function header do you need to declare each parameter separately?

A

Yes!!!!!!

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

Are return statements necessary for void functions?

A

No but you can use return; if it is helpful

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

To terminate the program if an invalid input is used you can use the function….

A

exit (int)

Where int is any integer

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

What is a function?

A

A collection of statements grouped together to preform an operation

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