lecture_notes_17

lecture_notes_17 - " f'-~ '---/ .../ '-,- '-,J\...

This preview shows pages 1–12. Sign up to view the full content.

("\ o - - - .- '-- , - - - .:s \$, --.~ oi;I G ~ -+ n ~r ~ ..., ::. ../ :/ . . (3 --- - ,\$;' --t -- -- - -- ;L 0 ..., - <. ' (\ c - ' A::::> +-1 c:. . t ;:. i+ . ..:s 2 -+ h

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

View Full Document
8 - - - - - - - - - (\ ---
- ----- - --- -- --- /* ECE 190 .Spring 2008 */ /* Example of a program wi~h a func~ion */ 'include <s~dio.h> in~ isI~Prime(in~ number); /* Declara~ion */ ~ in~ main ( ) { in~ iDHumber = 0; in~ prime = 0; prin~f("Inpu~ a number: "); scanf("%d", &iDHumber); prime = isI~Prime(iDHumber); .. /* Punc~ion Call */ if (prime) prin~f("I~ is a prime number.\n"); else prin~f("I~ is no~ prime.\n"); } /* Punc~ion Defini~~on */ his func~ion re~urns a 1 if prime, 0 o~herwise */ in~ isI~Prime(in~ number)~ in~ fac~or; for (fac~or = 2; fac~or < number; fac~or++) { if «number % fac~or) == 0) re~urn 0; } re~urn 1; } (0 .

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

View Full Document
W N -- ~ - c. " ,~ . - c ,~ ~'l cr- t' f'ia ~ - ~ f\ o . ---. --- -- ----
- ~ ~ ~ -+ 0 9 ~ - (c;)

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: " f'-~ '---/ .../ '-,- '-,J\ ,:\$---+---N-. '\---\/'J-'\,.J'J ..N' :;' :::>. ,-r .....-\--\? (J " 9 1, () .-\-c.. ..... 4-(' .., c. :> f ..., f". :> ..-. .-_r ,.-.-+ ""'" f'J (' c:rO X "----........... . A ('\ J r '- . .., 5---1 1. I ~ r ..J ,~ 1'--- --.. I ' oa () ,. ,. ,. . " (' ".--"1 , r l (1-() ..,--, i (' ;to r--+ J , I J J , \ ( S ( \ \' 1 I ~, I ( ( . \ ( ,-J '\ ( ( ~ r ( " ( . · f'J I VJ '" I 1\ ( ... I I ~ \ I--, I---. :::J __I .,1'\ () p---.----~. L.J>--.--,-' '2 r n V' ., (}d p t" ,.--r--,. VJ-' \$ G)----...
View Full Document

This note was uploaded on 02/21/2011 for the course MATH 243 taught by Professor Gao during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 12

lecture_notes_17 - " f'-~ '---/ .../ '-,- '-,J\...

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

View Full Document
Ask a homework question - tutors are online