Title: SEPT 29th
1SEPT 29th
Using FTP to access the contents of your Z drive
- Open Microsoft Internet Explorer or any browser
- Type the address as ftp//username_at_ftp.cs.odu.edu
- username is your CS login ID.
- On hitting enter, a new window pops up asking
your username - and password
- Make sure your username is your CS ID
- Enter your password (UNIX password or your
squirrel mail - password
- Click on OK
- You should be able to view the contents of your Z
drive. - You will not be able to edit the contents unless
you copy it into - your local drive on your computer
2Example 1
Lets see some functions!!! Sqrt(x) . Calculates
the square root of x. Pow(x, y) calculates
xy Write a program to find the area of a
square Try out area of a cube? TipDid u know
that u have to use include
3List of Predefined Functions
4Lets find the area of a square
Given Length of the square 4 cm. Area of a
square is (length)2 Now in Programming
language or C, I use the following way
to Evaluate the expression Two methods I
declare a variable L that takes the value of
the length of the square Method 1 Area L L
Method 2 Area pow(L, 2) LETS DO IT!!!!
5CONTROL STRUCTURES
Two Roads Diverged into the woodswhich one
should I chose? I chose basing on some
condition!!!! Control structures provide
alternatives to a sequential program Execution
and are used to alter the sequential flow of
execution. One control structure is SELECTION
Expression
True
False
Statement 1
Statement 2
6Logical Example
Suppose that Julia Roberts is my girlfriend and I
am about to go on a date with her. Well Julia
does not like rain. She wants to go to the
beach. But if it rains, she wants to go to the
movie to watch RUNAWAY BRIDE..she claims to be
acting in thatI dont believe!!
IF( Julia is in the movie) I believe her!!!
IF( Weather is raining) I am not going to the
beach or going to the movie OTHERWISE I am going
to the beach
7RELATIONAL OPERATORS
- Equal to
- ! Not Equal to
- Greater than
- Greater than Equal to
8SELECTION STATEMENT IN C
One way selection if(condition)
Two Way selection if(condition) else
Selection statements
Multi way selection switch case
9Example 3