110 - Software Development Flashcards
What is the print function in C?
Printf()
How to start a program?
- Decompose the problem into a small number of steps
2. Then again into subsets until you can start to program
What does this do?
for (i=0; i<10; i++)
{
print(“Hi!\n”);
}
It is a for loop that allocated the value of “0” to the variable called “i”. Then for states “for as long as i is less than 10, print “Hi” then add 1 each time
What does “%d” mean?
Print an integer
What does “scanf()” do?
It gets the user input
Always remember to do what?
Add meaningful comments to clarify what your code is trying to achieve
What does Camelcase look like?
camelCase
What is an Array?
Arrays provide a way for storing multiple instances of the same data type
What index is the 2nd place in the array and why?
Index 1 because the indexes start at index 0
What do functions do?
Create reusable units of code to help avoid repetition by factoring our common elements
What does “rand()” do?
It generates a random number.
Function definitions have what form?
Direct-declarator (parameter-type-list)
Functions DO NOT return what?
- A union
- An arithmetic type
- A function
- A structure
- An array
- A pointer
- A void
(Pick two)
A function and an array
In C, functions may have side effects (e.g. printing) what is not always needed to prevent this?
The return value
What does “void” mean?
It means that nothing is returned