Learn How to Program in Cby Dr. Kristin Switala
|
|
Review: Arrays (b)
Instructions: Think about each question and write the answer in your notebook.
White Box Testing
1. Fix the errors in this C source code. There are 5 errors.
|
#include <stdio.h>
void main( )
{
int i = 0;
int mars[2] = { 2, 3 };
int venus[3] = { 9, 10, 11, 12 };
printf("\nDuring the 1970s the USSR launched two probes to study the planet Mars:")
for(i = 0; i < 4; i++)
printf("\nMars %d", mars[i]);
printf("/nThey also launched four probes to study Venus:");
for(i = 0; i < 4; i++)
printf("\nVenera %d", venus[l]);
}
|
|
|