11/04/2015

C++ Program To Find Age Between 40 To 60

Problem :- Write A Program To Check Age Between 40 To 60 Using IF/Else Statement .

Logic :- Put a condition That Age should be Between 40 to 60
Condition is (age<=60)&&(age>=40) See for more Geeksforgeeks Solution For " Average " .

Solution :-

#include<iostream>
using namespace std;
int main()
{
    int age;
    //By-Ghanendra Yadav
    int i,count=0;
    
    cout<<"Enter The Age Of 10 People\n";
for(i=0;i<10;i++)
    {
        cin>>age;
   
        if((age<=60)&&(age>=40))
       count=count+1;
         else continue;
    }
  cout<<"The Age Between 40 to 60:"<<count<<endl;;
  return 0;
}

Output:-

C++ Program To Find Age Between 40 To 60

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: