#include<iostream>
using namespace std;
void GPACompute(int n){
float arr[n];
cout<<"Enter the GPA of "<<n<<" students\n";
for(int i=0; i<n; i++){
cout<<"GPA for student "<<(i+1)<<endl;
cin>>arr[i];
}
cout<<"GPA of students who have more than 3.5 are: \n";
for(int i=0; i<n; i++){
if(arr[i]>3.5){
cout<<arr[i]<<endl;
}
}
}
//Driver code
int main(){
int n;
cout<<"Enter the class size \n";
cin>>n;
GPACompute(n);
}
Comments
Leave a comment