Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int fyo, myo;
- int main()
- {
- int yyo, gmyo, gfyo;
- myo = -1;
- printf("How old are you?\n");
- scanf("%d",&yyo);
- if (yyo > 0){
- printf("You are %d years old\n", yyo);
- }
- else {
- printf("You is not exist.\n");
- }
- printf("How old is your father?\n");
- scanf("%d",&fyo);
- if (fyo > 0) {
- if (fyo > yyo) {
- printf("Your father is %d years old\n", fyo);
- printf("Your father was %d years old, when you was born.\n", fyo-yyo);
- }
- else {
- printf("Your father is young than you :D\n", fyo);
- }
- }
- else {
- printf("Your father is not exist.\n");
- }
- do {
- printf("How old is your mother?\n");
- scanf("%d",&myo);
- if (myo < 0 || myo < yyo) {
- printf("It's not correct.\n");
- }
- } while (myo < 0 || myo < yyo);
- switch (myo) {
- case 77: printf("Your mother and father are the same age"); break;
- default: printf("Your mother is %d years old\n", myo);
- printf("Your mother was %d years old, when you was born.\n", myo-yyo); break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement