This is C Program Write a Magic Number Program. In this program user ask to guess whether the guessed number is correct or not. The casually in this program the Control Statement will be used like if-else. If the guessed number is equal to the number that set for variable then it’s right else it will be wrong the variable declared which use to contain the given value for condition checks out. After the condition got completed the result will be on the display.
This is the program to check out the magic number from guessing digit.
- Enter the digit for check.
- Execute the control statement.
- Display result on the screen
Here is source code of the C program to check out the magic number from guessing digit. The C program is successfully compiled. The program output is also shown below.
int magic =23;
printf("Enter your Guess for the Number : ");
printf("\nCongratulation Right Guess");
printf("\nSorry Wrong Guess");
Enter your Guess for the Number : 23
Congratulation Right Guess