SYSC 2006 Lecture Notes - Lecture 2: Double-Precision Floating-Point Format

134 views2 pages

Document Summary

Sysc 2006 lecture 02 -- first look at a program in c. #include int main(void) int lower, upper, step; float fahr, celsius; ** this is an example of a program in c which converts a temperature value from fahrenheit to celsius. ** semicolons are commonly used after statements in c (ex. Note: indentation in c is completely optional, however it is 100% recommended so that programmers can read and understand your code well. Note: a / b in c (where a" and b" are ints) is equivalent to a // b in python. /* and */ are used as the opening and closing brackets for blocks of code. Assigning values to variables can be done as seen above. Note that you do need to state the type of variable that you are assigning, it is not done automatically. Lower, upper, and step store integer values (type int) because they were defined as such beforehand.

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