Unit 3 Graded Exercise 2 Calculate the Average using an Array.docx - :CalculatetheAverage usinganArray#include <stdio.h> int main cfw int n i float

Unit 3 Graded Exercise 2 Calculate the Average using an Array.docx

This preview shows page 1 out of 1 page.

Unit 3 Graded Exercise 2: Calculate the Average using an Array #include <stdio.h> int main() { int n, i; float num[100], sum = 0.0, average; printf( "Enter the numbers of elements: " ); scanf( "%d" , &n); while (n > 100 || n <= 0) { printf( "Error! number should in range of (1 to 100).\n"
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Spring '17
  • Grammatical number, Carriage return, printf, sum += num

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture