Sunday, July 12, 2015

Age Checker in C++

A simple program  that I wrote in C++ to check if the age of the person is minor or already an adult I wrote this code while I'm still learning how to program in C++.

Feel free to use my code in your programming projects at school or work.  If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

People here in the Philippines can reach me at my mobile number 09173084360.

Thank you very much and Happy Programming.



Program Listing

#include <iostream>

 using namespace std;

  int ages(int a) {
      if (a >= 18) {
          cout << "You are an adult";
      }
      else
      {
      cout << "Still a Minor";
      }
  }

  main() {
      int age2[1];

      cout << "Enter your age :";
            cin >> age2[0];
      cout << "\n\n";
      ages(age2[0]);
      cout << "\n\n";
      system("pause");
  }

No comments:

Post a Comment