Q:

C++ program to detrermine a candidate’s age is eligible for casting the vote or not

0

C++ program to detrermine a candidate’s age is eligible for casting the vote or not

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 Candiateage;

    cout << "Input the age of the candidate :"<<endl;
    cin >> Candiateage;

    if (Candiateage < 18)
    {
        cout << "Sorry, You are not eligible to caste your vote." <<endl;
        cout << "You would be able to caste your vote after " << 18-Candiateage << " year" <<endl;
    }
    else
    {
         cout << "Congratulation! You are eligible for casting your vote." << endl ;
    }
    return 0;

}

Result:

Input the age of the candidate :

16

Sorry, You are not eligible to caste your vote.

You would be able to caste your vote after 2 year

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

total answers (1)

C++ program to find the eligibility for an enginee... >>
<< C++ program to accept two integers and check wheth...