make a c program to input 20 integers. output the average of all positive odd integers
#include<iostream>
using namespace std;
int p, N=0;
float s=0;
bool odd(int a){
if (a%2!=0) return true;
& else return false;
}
void main(){
for (int i=0; i<20; i++) {
& cout<<"enter a number: ";
& cin>>p;
& if ((p>=0)&&(odd(p))) { s += p; ++N; }
}
cout<<"The average of all positive odd integers is "<<s/N<<"\n";
system("pause");
}