Presentation is loading. Please wait.

Presentation is loading. Please wait.

The C Language 1/31/14.

Similar presentations


Presentation on theme: "The C Language 1/31/14."— Presentation transcript:

1 The C Language 1/31/14

2 Quiz Take quiz 1 on Blackboard Over vim, linux, and Chapter 1.

3 Assignment On your own, answer the following questions. p.17 #1
Edit, compile and execute this program. p. 57 #3 submit jjarboe cs115 2 Read pp and Chapter 3 for next week.

4 C is a Functional Language
Example program ch2/retail.c Existing functions serve as basis for new functions. printf and library function used to create main

5 main Function Exactly one main() in a program
Tells other functions when to execute Calls them int main() -- Function Header { Body inside { } -- Executable Statements }

6 Comments /* Comment */ Ignored by compiler Documents program

7 Preprocessor Command #include <stdio.h>
Inserts code at that point Inserts the code before the compile Provides interface with printf and scanf functions

8 printf Sends argument to monitor screen printf(“Hello, Steve\n”);

9 Programming Style What is wrong with style2.c? No Syntax Errors

10 Programming Style Indentation Comments Meaningful identifiers
Indent statements between { } Comments Name, Date, Description of program Meaningful identifiers “counties” instead of “x”

11 Questions Give an example of a preprocessor command.
What are two rules for good programming style?

12 Next Data Types and Arithmetic Operations


Download ppt "The C Language 1/31/14."

Similar presentations


Ads by Google