C Programming Ch1-3

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

11 Terms

1
New cards

6 Phases for program execution

  1. edit - programmer creates a file in editor

  2. precompress - inserts contents of other files and text replacements

  3. compile - creates object code and stores it on disk

  4. link - fills in functions referenced from libraries

  5. load - program is loaded from disk to memory

  6. execute - computer follows code

2
New cards

Errors

  • syntax - compiler can’t recognize code because it isn’t in the right language

  • runtime - occur as the program runs

  • fatal - program terminates without performing its job

  • nonfatal - program runs to completion producing incorrect results

3
New cards

comments

  • // COMMENT

  • /* COMMENT */

4
New cards

Code must-haves

  • # include <stdio.h>

  • int main(void) { }

  • printf (“ PRINTED TEXT \n “);

  • scanf (“%d”, &VARIABLE); (for integer)

  • printf ( “ COMMENT %d COMMENT ” , VARIABLE); (printing string with variable)

5
New cards

escape sequences

  • \n - newline

  • \t - tab over

  • \a - produces sound or visible alert

  • \\ - how to put a \ in a string

  • \” - how to put a “ in a string

6
New cards

initializing variables

  • int VARIABLE = VALUE

  • double VARIABLE = VALUE

  • variable names can have letters, digits, and underscores, and can’t start with numbers

7
New cards

operators

  • + - addition

  • - - subtraction

  • * - multiplication

  • / - division (integer division gives an integer result)

  • % - remainder (mod)

8
New cards

if statement

if (CONDITION) {

printf (“ %d COMMENT %d”, VARIABLE1, VARIABLE2); }

9
New cards

algorithm

a procedure for solving a problem with: actions in order

10
New cards

program control

the order in which statements should execute

11
New cards

pseudocode

an informal artificial language