Question:
24students registered to the class. Write C++ program to find how many students with age range of:
//- less than 25
//- 26-30
//- 31-40
//- 41 and above
Please try to help me to write the above program.I have written some lines of code for taking the input value from user for number of students. Is there any function available for storing the input values from user.
coulud anyone please send the solution for the above program.
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
main()
{
int numberofstudents=0;
int age=0;
int count=1;
cout<<"enter number of students"<<endl;
cin>>numberofstudents;
count=numberofstudents-1;
cout<<"enter their age"<<endl;
while(!numberofstudents <= count )
{
cin>>age;
cout<<"age=="<<age<<endl;
count--;
}
return 0;
}