Wednesday, 12 October 2016

HHW Q3. WAP to enter age of a person and check his eligibility to vote .

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
cout<<"Enter your present age ";
cin>>a;
if (a>=18)
   { cout<<"You are Eligible to vote ";
   }
else
   { b=18-a;
     cout<<"You are not eligible to vote but after "<<b<<" years you will be eligible to vote ";
   }
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...