Lab7 - ECS 102 Lab 7 Spring 2011 Name _ Section 1(3:45)...

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

View Full Document Right Arrow Icon
Lab 7 Spring 2011 Name _____________________________________________ Section 1(3:45) 2(12:45) Anywhere that I ask you to observe what happens, write down your observations in the space provided. Before entering code, finish reading the instructions for that part! I. Experimenting with functions. Here are several functions to work with. (Don't do anything with them until you get to part A.) Notice that rewriter does not return a value, but triple and divAndMod both do return a value. Notice that rewriter and divAndMod both print something to the monitor, but triple does not . Notice that the parameter of rewriter is a char, the parameter of triple is a double, and the parameters of divAndMod are both int. /* print the parameter 5 times. Note, no new line at end.*/ void rewriter(char let) { printf("%c%c%c%c%c",let,let,let,let,let); } /* triple the number n. Note, no printed output. */ double triple(double n) { double answer; answer = 3.0 * n; return(answer); } /* prints num/div, returns num%div */ int divAndMod(int num, int div) { int quotient; int remainder;
Background image of page 1

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

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

This note was uploaded on 05/05/2011 for the course EEE 212 taught by Professor Des during the Spring '11 term at Syracuse.

Page1 / 5

Lab7 - ECS 102 Lab 7 Spring 2011 Name _ Section 1(3:45)...

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

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