Advertisement
Guest User

Untitled

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