Lecture 08 - Conditionals

Lecture 08 - Conditionals - Announc e m e nts 08 Co ndit io...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
08 Conditionals Oct. 5, 2006 Announcements • Example Code now on web-page • Grades (for clicker quizzes) appearing tonight – clicker problems – be patient • Next week’s labs: – Monday, Holiday – No formal lab material, go to any lab listed on course outline • Assignment 2: Due in less than 6 days, 20 hours. Announcements (cont.) • Extra advising: – Friday (see Help section on web- page) – Next week (in labs) Assignment 2 • Any questions? Review • Saw more functions and scanf. • Saw examples of the importance of remembering when and when The Exception to a Rule • we can define a string as: – char my_string[256]; – this allows for a string of up to 255 characters + a special end of string marker (more on this later) • “%s” reads a word (separated by space or tab or return) • printf and scanf for strings never require an &
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example • char name[256]; • int age; • printf( “Enter your name: ” ); • scanf( “%s”, name ); • printf( “Enter your age: ” ); • scanf( “%d”, &age ); Example 2 • e.g. int get_age( ) { int age; printf( “Enter your age: “ ); scanf( “%d”, &age ); return age; } Example 3 • Reading characters: – char a_character; – scanf( “%c”, a_character );
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/17/2011 for the course CIS 1500 taught by Professor Kramer during the Spring '06 term at University of Guelph.

Page1 / 5

Lecture 08 - Conditionals - Announc e m e nts 08 Co ndit io...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online