Tuesday, 27 August 2013

matlab function to calculate "person is eligible for vote or not"

%syntax:vote(age)
%gives the o/p wether the person is eligible for vote or not

function vote(age)

age=input('enter the age of the person::');

if(age>=18)
    fprintf('age=%d so person is eligible for the vote',age)
else
    fprintf('age=%d so person is not eligable for vote',age)
end

No comments:

Post a Comment