Learn How to Program in C

by
Dr. Kristin Switala

Introduction

Directives

Variables

Conditionals

Loops

Arrays

Pointers

Strings

Functions

Structures


Site Map

Answers to Review: Loops (c)


White Box Testing

1. two errors:

  • line 9: for(loop = 1; loop < stop; ++loop)
  • line 10 should end with a semicolon ;

2. two errors:

  • line 10: for(count = 10; count < num; ++count)
  • in line 12, there should be three num, not two

3. two errors:

  • line 8: for( ; tries > 0; --tries)
  • in line 11, add an ampersand before the variable: &answer
Copyright
© 2001
Kristin Switala
Hosted by www.Geocities.ws

1