



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




/* arrayscope.c / / demonstrates a function that assigns to an array parameter */ #include <stdio.h>
/* function prototypes */ void clearArray (int values[], int numberOfElements); void notClearValue (int value);
int main ( ) { /* declare and define an array of length 12 */ int examples[5] = { 5, 7, -3, 15, 8 }; int mint = 999; int i;
/* call to the clear array function */ clearArray ( examples, 5);
/* print the elements of the array to observe the change */ for ( i = 0; i < 5; i++) { printf("Element %i of the array: %i\n", i, examples[i]); }
/* call the function that tries to clear the integer variable */ notClearValue (mint);
/* print the value of the variable after the call */ printf("\nThe value of the variable is: %i\n", mint);
return(0); }
/* Set all the elements of the array to zero / void clearArray (int values[], int numberOfElements) { int i; for ( i = 0; i < numberOfElements; i++) { values[i] = 0; } return; } / Set the value of the parameter to zero */ void notClearValue (int value) { value = 0; return; }
examples array as an argument. Print out the result of the standard deviation and write the
result here.
Standard deviation =
After you have completed the program, print it out and hand it in.