Hey guys i need some help..
Here is my code given below + the question statement..
The problem is simple i just wanted to ask what and how i can use variable to calculate average in array questions..
Problem Statement:
"Write a program that declares an array of 25 integers and populates the array by reading values from the user (i.e. reads 25 numbers from the user and puts them into the array). Now your program computes and displays the average of all the numbers that are between 10-80."
CODE:
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int x[25];
int count = 0, avg;
for(int i=0; i<25; i++)
{
cout<<"Please enter a number.."<<endl;
cin>>x[i];
}
for(int i=0; i<25; i++)
{
if(x[i]> 10 && x[i]<80)
{
count = count + 1;
}
}
//here lies the problem
avg = count/
//????
getch();
return 0;
}