Lecture3 - Beginning C for Engineers Spring 2008 Spring 2008 Lecture 3 Review Example Part 1 using math library RPI csci1190 2 Switch statement •

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Beginning C for Engineers Spring 2008 Spring 2008 Lecture 3 Review Example- Part 1: using math library 2/1/2008 RPI- csci1190 2 Switch statement • Choosing alternatives from a list of possibilities switch (controlling expression ) { case value: 2/1/2008 RPI- csci1190 3 statements case value: statements … default: statements } Switch Statement Case b break Case b action(s) Case a break Case a action(s) T F T F 2/1/2008 RPI- csci1190 4 Case z break Case z action(s) Default action(s) F T Switch Statement 2/1/2008 RPI- csci1190 5 Switch statement-Ex. 2/1/2008 RPI- csci1190 6 Assignment Operators • C provides many assignment operators for abbreviating assignment expressions: a = a + 2; is the same as: a += 2; 2/1/2008 RPI- csci1190 7 • General format: variable = variable operator expression as: variable operator= expression operator can be: +, -, *, /, % . Increment &decrement operators • C also provides unary increment operator, ++, and unary decrement operator, --, as following:...
View Full Document

This note was uploaded on 04/08/2008 for the course CSCI 1190 taught by Professor Minooaminian during the Spring '08 term at Rensselaer Polytechnic Institute.

Page1 / 22

Lecture3 - Beginning C for Engineers Spring 2008 Spring 2008 Lecture 3 Review Example Part 1 using math library RPI csci1190 2 Switch statement •

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

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