For this Question: A magic number is a natural number that contains both the digits 7 and 9 in it. For eg:- 79, 879, 53729 etc. 
Given a number N, your task is to find the closest Magic number from the given number N.

Note:- If more than one answer exists return the minimum one<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>MagicNumber()</b> that takes integer N as argument.

Constraints:-
1 <= N <= 100000Return a magic number closest to the given number N.Sample Input:-
8

Sample Output:-
79

Sample Input:-
900

Sample Output:-
897, I have written this Solution Code: int check(int n){
int s=0;
int p=0;
while(n){
if(n%10==7){s=1;}
if(n%10==9){p=1;}
n/=10;
}
if(s && p){return 0;}
return 1;
}

int MagicNumber(int n){
int i=0;
while(check(n-i) && check(n+i)){
i++;
}
if(check(n-i)==0){return n-i;}
else{
return n+i;}
}, In this Programming Language: C, Now tell me if this Code is compilable or not?