Code C Study Guide Test.
Code C Study Guide Test. #include cs50.h #include stdio.h - CORRECT ANSWER in all c50 code [data type] [variable] = get_[variable type]("[display]") - CORRECT ANSWER input syntax [data type] [variable] = [variable] - CORRECT ANSWER assigning variable syntax in all statements - CORRECT ANSWER ; printf("%[data type letter]", [variable]) - CORRECT ANSWER display variable int main(void){[all code]} - CORRECT ANSWER in all c programs if ([boolean statement]){[code]} else if {[code]} else{[code]} - CORRECT ANSWER boolean syntax code [fileName].c - CORRECT ANSWER open new file in terminal(other option is to add file in GUI) make [fileName] - CORRECT ANSWER used for compiling & recompiling by terminal command(import code language to machine code) ./fileName - CORRECT ANSWER execute code by terminal command '[char]' - CORRECT ANSWER what used if boolean compare char || - CORRECT ANSWER or boolean operator in boolean condition(repeat comparing variable) && - CORRECT ANSWER and boolean operator in boolean condition(repeat comparing variable) [variable] += 1;(subtract is self explanatory) - CORRECT ANSWER syntactic sugar for add 1(interchangable) while ([boolean]){[code]}(there is usually add/subtract variable in [code] and [boolean]// do while can introduce code before check) - CORRECT ANSWER while syntax for (int [variable]; [variable] [(in)equality symbol]; [variable(++/--/+=/-=)]) - CORRECT ANSWER for syntax (float) [int#] - CORRECT ANSWER converting int to float(type casting method//other method substitute int with float in operation) [dataType] [variable][[#ofItums]]; [variable][[0 to #-1]](repeated//can use for if # asked for) - CORRECT ANSWER array storage(call array with ex. variable[#]//form of abstraction)
Written for
- Institution
- Harvard University
- Course
- CS50
Document information
- Uploaded on
- May 26, 2024
- Number of pages
- 4
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs50
-
code c study guide test
Also available in package deal