Q:

C++ Program To Find Age Between 40 To 60

0

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) 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<iostream>
using namespace std;
int main()
{
    int age;
    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:

Enter The Age Of 10 People

90

39

20

19

14

32

75

37

50

64

The Age Between 40 to 60:1

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Program To Count Letters ,Space,Digits,And Oth... >>
<< C++ Program To Find The HCF Or LCM Of Given Number...