ECE 15 Lecture Notes - Lecture 2: Scanf Format String, Binary Number, Elementary Arithmetic

47 views8 pages

Document Summary

*useful for multiple line: the c printing function printf() prints formatted data in unix. This function is shared by many languages. b. The data types are represented by the arguments made after the quotes. (1, 2, 1+3). Int is the data type, and num and sum are two separate variable names: double weight = 0. 0; a. Integer: basic integer type; integers are unitialized (contains previously stored value) Integers can be assigned a value at either declaration or assignment: declaration, int a=0, int a=0, b=1; = does not mean equal, it means to store a value in the variable: assignment, int a; a=0, int a, b; a=0 b=1, int a, b; a=b=0, printing integers is the same as printing constants, printf( %d , a); i. A is the variable used as the argument for %d. Integers can be read (scans for human input) by using the function.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents