Showing posts with label fortune teller in C. Show all posts
Showing posts with label fortune teller in C. Show all posts

Wednesday, September 23, 2015

Using if else construct in C - II

#include <stdio.h>
#include <conio.h>

void main ()
{
                clrscr();
                int a;
                printf("FORTUNE TELLER\n");
                printf("please Enter a number between 1 and 5:\t");
                scanf("%d", &a);
                if (a==1)
                {
                                printf("You will have a nice day\n");
                }
                else if (a==2)
                {
                                printf("You will meet some one special today\n");
                }
                else if (a==3)
                {
                                printf("You will win a lottery today\n");
                }
                else if (a==4)
                {
                                printf("You will get a special gift today\n");
                }
                else if (a==5)
                {
                                printf("You will find your true love today today\n");
                }
                else
                {
                                printf("Please enter a number between 1 and 5\n");
                }
                getch();
}
Output:  
FORTUNE TELLER
Enter a number between 1 and 5:   5
You will find true love today.