R
RobBob
Can anyone help me with this.I have to write a program that prompts a user
for his or her age, then computes whether they are old enough to vote - age
18. If they are too young, your program should inform them that they can
vote in XX years. If they are old enough, you should inform them that they
have been eligible to vote for YY years.
So far this is what I've come up with but I keep getting errors:
#include <stdio.h>
#include <stdlib.h>
int age;
printf("please enter your age:");
get(age);
if(age<18)
total=18-age
{
printf("I'm sorry you are too young to vote. You will be eligible
to vote in '%;' years");
}
else
total=age-18
{
printf" You can vote! You have been eligible to vote for, '%;'
years");
}
return()
for his or her age, then computes whether they are old enough to vote - age
18. If they are too young, your program should inform them that they can
vote in XX years. If they are old enough, you should inform them that they
have been eligible to vote for YY years.
So far this is what I've come up with but I keep getting errors:
#include <stdio.h>
#include <stdlib.h>
int age;
printf("please enter your age:");
get(age);
if(age<18)
total=18-age
{
printf("I'm sorry you are too young to vote. You will be eligible
to vote in '%;' years");
}
else
total=age-18
{
printf" You can vote! You have been eligible to vote for, '%;'
years");
}
return()