Advertisement
aungzayoo199651

Change_Age_To_m,w(or)d

Mar 29th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3.  
  4. int main()
  5. {
  6.     int change;
  7.     int age;
  8.     int result;
  9.     printf(" 1. month\n 2. week\n 3. day\n");
  10.     printf("Choose month, week or day:==>>>\n");
  11.     scanf("%d", &change);
  12.     if(change == 1){
  13.         printf("Enter Your Age\n");
  14.         scanf("%d", &age);
  15.         result=age*12;
  16.         printf("month = %d", result);
  17.     }else if (change==2){
  18.         printf("Enter Your Age\n");
  19.         scanf("%d", &age);
  20.         result=age*52;
  21.         printf("week = %d", result);
  22.     }else if(change==3){
  23.         printf("Enter Your Age\n");
  24.         scanf("%d", &age);
  25.         result=age*365;
  26.         printf("day = %d", result);
  27.     }else{
  28.         printf("error");
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement