ENGR 3 rocks. Your friendly TA Damon Good list of VI commands Good online free guide to Linux (time-sucker)

Slides:



Advertisements
Similar presentations
Recursion Prog #include <stdio.h> #include<conio.h> main()
Advertisements

C Functions. What are they? In general, functions are blocks of code that perform a number of pre-defined commands to accomplish something productive.
DS:Lab-1 Prepared by: Shipra Shukla Assistant Professor Kaziranga University.
ARDUINO CLUB Session 1: C & An Introduction to Linux.
Computer Science 2212a/b - UWO1 Structural Testing Motivation The gcov Tool An example using gcov How does gcov do it gcov subtleties Further structural.
Sort the given string, without using string handling functions.
C Intro.
By Senem Kumova Metin 1 POINTERS + ARRAYS + STRINGS REVIEW.
Solution April 13, #include int main( void ) { int salaries[ 11 ] = { 0 }; /*total salary */ int sales; /* sales per karyawan */ double salary;
Growing Arrays in C By: Victoria Tielebein CS 265- Spring 2011.
Understanding Loops Using C Language Week 15 Mr.Omer Salih.
ENGR 3 rocks. Hi I’m Damon Turney Homework 0 due October 7 ! Get a computer account.
What is the best way to start? 1.Plug in n = 1. 2.Factor 6n 2 + 5n Let n be an integer. 4.Let n be an odd integer. 5.Let 6n 2 + 5n + 4 be an odd.
5.2 The Integers. Whole Numbers The set of whole numbers contains the set of natural numbers and the number 0. Whole numbers = {0,1,2,3,4,…}
1 Introduction to Computers and Programming Class 3 Introduction to C Professor Avi Rosenfeld.
ENGR 3 rocks. Debugging Skills Read the error message. Try to decipher which line of C code is causing the problem. Read that line of code carefully for.
Testing a program Remove syntax and link errors: Look at compiler comments where errors occurred and check program around these lines Run time errors:
Basic Input/Output and Variables Ethan Cerami New York
CMSC 104, Version 8/061L22Arrays1.ppt Arrays, Part 1 of 2 Topics Definition of a Data Structure Definition of an Array Array Declaration, Initialization,
C PROGRAMMING LECTURE 17 th August IIT Kanpur C Course, Programming club, Fall by Deepak Majeti M-Tech CSE
COP 3275 COMPUTER PROGRAMMING USING C Instructor: Diego Rivera-Gutierrez
Homeworkhomework. RUBRIC ANSWER THE QUESTION CORRECTLY MORE THAN 2 PARAGRAPHS TYPED BIBLIOGRAPHY.
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
C Functions Programmer-defined functions – Functions written by the programmer to define specific tasks. Functions are invoked by a function call. The.
Agenda  Perform Quiz#2 (20 Minutes)  Functions / Continued … –Functions - Definition –Types of Functions: Functions that do not accept or return a value.
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
1 計算機程式設計 Introduction to Computer Programming Lecture01: Introduction and Hello World 9/10/2012 Slides modified from Yin Lou, Cornell CS2022: Introduction.
Lecture-2 Operators and Conditionals. Variables(again???) Type: Representation of “bits” in memory Variables: Name for a memory object. Starts with letters,
How to start Visual Studio 2008 or 2010 (command-line program)
1 C Programming Week 2 Variables, flow control and the Debugger.
Engr 0012 (04-1) LecNotes Engr 0012 (04-1) LecNotes C++ errors/debugging build/compile compiler does not recognize a statement build/compile.
Chapter 5 – Functions II Outline Recursion Examples Using Recursion: The Fibonacci Series.
1 Flight Times. 2 Problem Specification 3 Additional Specifications You may assume that the input is a valid 24 hour time. Output the time entered by.
EXERCISE Arrays, structs and file processing. Question An online store sells various types of children’s clothing. You are to create a program that stores.
15213 Recitation Section C Introduction Unix and C Playing with Bits Practice Problems Shimin Chen Sept. 9, 2002 Outline.
Selection-making Decisions Selection allows you to choose between two or more possible program flow --- it lets you make decisions in your program. Examples.
EXERCISE Arrays, structs and file processing. Question You own a pet store. You want to keep an inventory of all the pets that you have. Pets available.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
The ‘while’ loop ‘round and ‘round we go.
Divisibility Tests How can you tell quickly whether a number can be divided exactly by another?
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 2 September 3, 2009.
CS1010: Programming Methodology
Arithmetic You can perform arithmetic with numbers and/or variables. Java follows mathematical order of operations (PEMDAS). Example: / 2  this.
REEM ALAMER REVISION FOR C LANGUAGE COURSE. OUTPUTS int main (void) { int C1, C2; int *p1, *p2; C1 = 8; p1 = &C1; C2 = *p1 / 2 + 5; p2 = &C2; printf ("C1.
Chapter 5: Preparing C Programs
Week 4 – Chapter 3 Repetition.
Warm Up Factor the following expressions completely: 14a2 + 7a
Arrays, Part 1 of 2 Topics Definition of a Data Structure
The while Looping Structure
CSI-121 Structured Programming Language Lecture 14 Functions (Part 2)
Few More Math Operators
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
Dr. Joe Anderson September 6, 2017
IPC144 Introduction to Programming Using C Week 3 – Lesson 2
The while Looping Structure
Introduction to C Topics Compilation Using the gcc Compiler
For Loops.
The ‘while’ loop ‘round and ‘round we go.
Chapter 2 - Introduction to C Programming
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Conditionals.
Relational, Logical, and Equality Operators
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Introduction to C Topics Compilation Using the gcc Compiler
Chapter 2 - Introduction to C Programming
The while Looping Structure
The while Looping Structure
DIVISION OF INTEGERS 1-9.
Presentation transcript:

ENGR 3 rocks

Your friendly TA Damon

Good list of VI commands Good online free guide to Linux (time-sucker) Good online free guide to C commands

To search these websites use Google in the following way tcsh site: or printf site:

Homework 7 Let’s get ‘er done. A quick example: Ask user to enter an integer. Make C determine if the integer is even or odd. Tell the user if it is even or odd. If the user entered zero, warn them about it.

/*A prorgram that determines if an integer is even or odd.*/ #include int main() { int integer; printf( "\nEnter an integer: " ); scanf( "%d", &integer ); /*If the user entered 0 then give error*/ if ( integer == 0 ) { printf(“Warning: Evenness of zero is disputed.\n"); return 1; }

/*use mod to determine if the integer is even*/ /*if the integer is divisible by 2 then it is even*/ if ( integer % 2 == 0 ) { printf( "It is an even integer.\n"); }/*if integer is not divisible by 2 then it must be odd*/ else { printf( "It is an odd integer.\n"); } return 0; }

% gcc evenodd.c -o evenodd.out % evenodd.out Enter an integer: 34.4 It is an even integer. % evenodd.out Enter an integer: 0 Warning: Evenness of zero is disputed.

Time to work on Homework 7.