Learn How to Program in C

by
Dr. Kristin Switala

Introduction

Directives

Variables

Conditionals

Loops

Arrays

Pointers

Strings

Functions

Structures


Site Map

Review: Strings (a)

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 2 errors.

#include<stdio.h>
void main( )
{
char name[8] = "Angelle Seeling";
printf("The world's fastest woman on two wheels is %c.", name);
}

2. Fix the errors in this C source code. There are 2 errors.

#include<stdio.h>
void main( )
{
char cyclists[3][40] = {

{"Carl Fogerty"},
{"Kenny Roberts, Jr."},
{"Angelle Seeling"},
{"Jeremy McGrath"}


printf("%s is the king of Supercross.\n", cyclists[3]);
printf("%s is the queen of drag racing.", cyclists[2]);
}

Copyright
© 2001
Kristin Switala
Hosted by www.Geocities.ws

1