Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int age;
  5. printf("Enter your age: \n ");
  6. scanf_s("%d", &age);
  7. if (age >= 18 && age < 100) {
  8. printf("You have the right to vote");
  9. }
  10. else if (age < 18 && age > 0) {
  11. age = 18 - age;
  12. printf("The number of years after which you can vote - %d\n", age);
  13. }
  14. else {
  15. printf(" Incorrect data entered ");
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement