chap 4 notes 81 - for loop: k nfact 6 120 Since k has...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
81 nfact = 1 ; int n = 5 ; for (int k= 2 ; k<=n; k++) { nfact*=k; } Example: Factorial Consider the following
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for loop: k nfact 6 120 Since k has exceeded n , the loop is terminated....
View Full Document

Ask a homework question - tutors are online