Index-1              Index-2              Home Page

Comparison Operator

Write and run a program that reads the users age and then prints "You are a Child" if the age < 18, " You are an adult." if 18<=age<65, and "You are a senior citizen." if age >=65.

<< Go to Index Page >>

50 comments:

  1. #include
    #include
    main()
    {
    int age;
    printf("enter your age: ");
    scanf("%d",&age);
    if(age<18)
    printf("you are child");
    else if(18<=age<=65)
    printf("you are adult");
    else if(age>65)
    printf("you are senior citizen");
    getch();
    return 0;
    }

    ReplyDelete
  2. #include

    main()
    {
    int age;
    while(scanf("%d", &age)==1)
    {
    if(age<18)
    printf("You are a Child.\n");
    else if(age>=18&&age<65)
    printf("You are an adult.\n");
    else if(age>=65)
    printf("You are a senior citizen.\n");
    }

    return 0;
    }

    ReplyDelete
  3. carry on.......and will be continued......

    ReplyDelete
  4. #include
    main(){
    int a;
    printf("Enter your age : ");
    scanf("%d",&a);
    if(a<18)
    printf("your are child!");
    else if(a>=18 && a<=65) printf("you are matured!");
    else printf("you are senior citizen");
    }

    ReplyDelete
  5. Summer 2017
    ID#201610042

    Answer to the Question No. 5:

    https://drive.google.com/file/d/0B99eePh0LV8gR1BHY1c3eXZCcUU/view?usp=drivesdk

    ReplyDelete
  6. https://www.dropbox.com/s/36plauesvs5xinr/age5.cpp?dl=0

    ReplyDelete
  7. https://www.dropbox.com/s/kswhmxj1qgy66s7/AGE.cpp?dl=0

    ReplyDelete
  8. https://www.dropbox.com/s/ep22h2f26bre576/agewithparamiter.cpp?dl=0

    ReplyDelete
  9. https://www.dropbox.com/s/h9uykmc7i537sv7/agewithparamiterwithreturn.cpp?dl=0

    ReplyDelete
  10. https://www.dropbox.com/s/39de6fy4lmxuapv/cal.cpp?dl=0

    ReplyDelete
  11. https://drive.google.com/file/d/0B0Llv4Ca9Ln6SXdSZFZkUUxvM1k/view?usp=sharing

    ReplyDelete
  12. corrected one;

    https://drive.google.com/file/d/0B0Llv4Ca9Ln6a3ZqWF9zS0lIOEE/view?usp=sharing

    ReplyDelete
  13. ID : 201620195
    https://drive.google.com/open?id=0B9K31ospCyFjUkNSd2FCMEtvNHc

    ReplyDelete
  14. https://drive.google.com/open?id=0BzTqZMBWR6eOYzlhUDdQV2UySm8

    ReplyDelete
  15. https://drive.google.com/open?id=0B8369pAqjVVpcHozaEFsM2NRRmM

    ReplyDelete
  16. wp. https://drive.google.com/open?id=0B8369pAqjVVpYjJycEpjVmhVQkU

    ReplyDelete
  17. ID:201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2a2N3QkoxazlpSEU

    ReplyDelete
  18. ID:201520552
    https://drive.google.com/open?id=0B5pG0kIjzgEKbXM1Y09rWjJOT3M

    ReplyDelete
  19. ID 201610456
    MD USUF MIA
    https://drive.google.com/open?id=0B_PIGnOMR0K2enY2SjZ3cTRvVGc

    ReplyDelete
  20. https://drive.google.com/open?id=0B7UQyRdu6h2wZmRjMXR0d0l2Nnc

    ReplyDelete
  21. https://drive.google.com/open?id=0Byxq3aat_mNSTzdOcHdyNzl1RkU

    ReplyDelete
  22. https://www.dropbox.com/s/a9xi1enq5nvh7cc/HW5%20witn%20constructor.cpp?dl=0

    ReplyDelete
  23. Md Nadim Khandaker
    ID: 201630510

    #include
    using namespace std;
    class people
    {
    public:
    int sum;
    void calculateage(int age)
    {
    if(age<18)
    cout<<"You are a child"<=18 && age<65)
    cout<<"you are an adult"<=65)
    cout<<"You are a senior citizen"<>age;

    people man;
    man.calculateage(age);
    }

    ReplyDelete
  24. https://drive.google.com/open?id=0BzKpnVbF4fc3NG1ValNVb3FMUFU

    ReplyDelete
  25. Name:Abdullah Papon
    ID:201710933
    https://drive.google.com/open?id=0B0bbxKUPFizZcmhScGFGcFdOQk0

    ReplyDelete
  26. https://drive.google.com/open?id=0B3bVD5Ppt_STOFQ5dFE1UVJwbEE

    ReplyDelete
  27. Id= 201710494
    https://www.dropbox.com/s/z5f6ag4f7gi09mv/prob%205.cpp?dl=0

    ReplyDelete
  28. https://drive.google.com/open?id=0BxajN_bZJJw0Tl9FMGdNTEN1X0E

    ReplyDelete
  29. https://www.dropbox.com/s/bctvl89kdmgv1fk/AGE.cpp?dl=0

    ReplyDelete
  30. https://drive.google.com/open?id=0B97tDB8iESNCdElmSXBQM3hqMnM

    ReplyDelete
  31. https://drive.google.com/open?id=0B8uArqPAKtGrM1phdE1jcGU1NWc

    ReplyDelete
  32. https://drive.google.com/open?id=0B8uArqPAKtGrM1phdE1jcGU1NWc

    ReplyDelete
  33. https://drive.google.com/open?id=0B8uArqPAKtGrX3FqcUFhMHJ6clU

    ReplyDelete
  34. ID: 201620318
    https://drive.google.com/open?id=0B2gcteJZycWoN2NOMHgwVGdGM0U

    ReplyDelete
  35. https://drive.google.com/open?id=0B5eevQy6QwSOS0dIYk1QNTZEX1k

    Name: Bithi Paul, ID:201631161

    ReplyDelete
  36. https://drive.google.com/open?id=0Bw0-FMVCC94QWnRMVEJBVnJqZW8

    ReplyDelete
  37. ID:-201610058

    1.https://drive.google.com/open?id=0B7UQyRdu6h2wZmRjMXR0d0l2Nnc

    ReplyDelete
  38. Post writing is also a excitement, if you be familiar with afterward you
    can write otherwise it is difficult to write.

    ReplyDelete
  39. #include
    int main(void){
    int age;
    printf("Enter your age ");
    scanf("%d",&age);

    if ( age < 18){
    printf(" You are a Mainor %d", age);
    }
    else if ( age <= 18){
    printf(" You are a Adult %d", age);
    }
    else if ( age >=65){
    printf(" You are a Senior Citizen%d",age);
    }

    return 0;
    }

    ReplyDelete
  40. #include
    int main(void){
    int age;
    printf("Enter your age ");
    scanf("%d",&age);

    if ( age < 18){
    printf(" You are a Mainor %d", age);
    }
    else if ( age <= 18){
    printf(" You are a Adult %d", age);
    }
    else if ( age >=65){
    printf(" You are a Senior Citizen%d",age);
    }

    return 0;
    }

    ReplyDelete
  41. #include
    int main(void){
    int age;
    printf("Enter your age ");
    scanf("%d",&age);

    if ( age < 18){
    printf(" You are a Mainor %d", age);
    }
    else if ( age <= 18){
    printf(" You are a Adult %d", age);
    }
    else if ( age >=65){
    printf(" You are a Senior Citizen%d",age);
    }

    return 0;
    }

    ReplyDelete
  42. #include
    int main(void){
    int age;
    printf("Enter your age ");
    scanf("%d",&age);

    if ( age < 18){
    printf(" You are a Mainor %d", age);
    }
    else if ( age <= 18){
    printf(" You are a Adult %d", age);
    }
    else if ( age >=65){
    printf(" You are a Senior Citizen%d",age);
    }

    return 0;
    }

    ReplyDelete
  43. ID: 201820244
    Batch: 58th
    section:B

    #include
    using namespace std;

    class manush
    {
    int age;

    public:
    void get_age(void)
    {
    cout<<"Enter your age for your own identity: ";
    cin>>age;
    }

    void check_age(void)
    {
    if (age<0)
    cout<<"You haven't born yet!"<<endl;
    else if (age<18)
    cout<<"You are a child"<<endl;
    else if (age<65)
    cout<<"You are an adult"<<endl;
    else
    cout<<"You are a senior citizen"<<endl;
    }
    };

    int main()
    {
    manush obj;

    obj.get_age();
    obj.check_age();

    return 0;
    }

    ReplyDelete
  44. #include
    using namespace std;

    class manush
    {
    int age;

    public:
    void get_age(void)
    {
    cout<<"Enter your age for your own identity: ";
    cin>>age;
    }

    void check_age(void)
    {
    if (age<0)
    cout<<"You haven't born yet!"<<endl;
    else if (age<18)
    cout<<"You are a child"<<endl;
    else if (age<65)
    cout<<"You are an adult"<<endl;
    else
    cout<<"You are a senior citizen"<<endl;
    }
    };

    int main()
    {
    manush obj;

    obj.get_age();
    obj.check_age();

    return 0;
    }

    ReplyDelete
  45. ID# 201830546

    #include
    using namespace std;

    class age
    {
    public:
    int a;

    void agecun()
    {
    cout<<"Enter Your Age:\n";
    cin>>a;
    if(a<18)
    cout<<"You are a Child";
    else if(18<a && a<65)
    cout<<"You are an adult.";
    else
    cout<<"You are a senior citizen.";
    }
    };

    main()
    {
    age s;

    s.agecun();
    }

    ReplyDelete
  46. ID-201820298
    58 BATCH

    #include
    using namespace std;
    class human
    {
    public:
    int agei;
    void ageii()
    {
    cin>>agei;
    if(agei<18)
    cout<<"you are a child"<=18&&agei<65)
    cout<<"you are an adult"<=65)
    cout<<"you are senior"<<end1;
    }
    };

    int main()
    {
    age ageiii;
    ageiii.ageii();
    }

    ReplyDelete
  47. Name : Firoj Ahmed
    ID : 201820222
    Batch : 58th

    1.
    #include
    using namespace std;

    class age
    {
    public:
    int a;

    void agecun()
    {
    cout<<"Enter Your Age:\n";
    cin>>a;
    if(a<18)
    cout<<"You are a Child";
    else if(18<a && a<65)
    cout<<"You are an adult.";
    else
    cout<<"You are a senior citizen.";
    }
    };

    main()
    {
    age sa;

    sa.agecun();
    }

    ReplyDelete
  48. Id:201820505
    Batch:58th
    #include
    #include
    main()
    {
    int age;
    printf("enter your age: ");
    scanf("%d",&age);
    if(age<18)
    printf("you are child");
    else if(18<=age<=65)
    printf("you are adult");
    else if(age>65)
    printf("you are senior citizen");
    getch();
    return 0;
    }

    ReplyDelete
  49. #include
    #include
    main()
    {
    int age;
    printf("enter your age: ");
    scanf("%d",&age);
    if(age<18)
    printf("you are child");
    else if(18<=age<=65)
    printf("you are adult");
    else if(age>65)
    printf("you are senior citizen");

    }

    ReplyDelete
  50. Id:201820244
    "Section:B
    Batch:58th
    #include
    using namespace std;
    class manush
    {
    public:
    int age;
    manush()
    {
    cout<<"Enter your age: ";
    cin>>age;
    }
    ~manush(){

    }
    Checkshow_status(void)
    {
    if (age<0)
    cout<<"You haven't born yet!"<<endl;
    else if (age<18)
    cout<<"You are a child"<<endl;
    else if (age<65)
    cout<<"You are an adult"<<endl;
    else
    cout<<"You are a senior citizen"<<endl;
    }
    };

    int main()
    {
    manush obj;
    obj.Checkshow_status();
    return 0;
    }

    ReplyDelete