Advertisement
DrAungWinHtut

3-lucky.c

Mar 2nd, 2023
769
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include<stdio.h>
  2. int lucky()
  3. {
  4.     int year = 0;
  5.     int month = 0;
  6.     int day = 0;
  7.  
  8.     int sum = 0;
  9.     int mod = 0;
  10.  
  11.     printf("Lucky Star\n");
  12.     printf("==========\n");
  13.  
  14.     for (int i = 0; i < 5; i++) //i++ -> i = i+1;
  15.     {
  16.         printf("Please enter birthday dd-mm-yyyy : ");
  17.         scanf_s("%d-%d-%d", &day, &month, &year);
  18.  
  19.         sum = year + month + day;
  20.         mod = sum % 3;
  21.         if (mod == 0)
  22.         {
  23.             printf("You are not LUCKY\n");
  24.         }
  25.         if (mod == 1)
  26.         {
  27.             printf("You are NORMAL\n");
  28.         }
  29.         if (mod == 2)
  30.         {
  31.             printf("You are  LUCKY\n");
  32.         }
  33.     }
  34.  
  35.    
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement