scope of macro puzzle :     
    #include <iostream>
    using namespace std;
    
    void sum(){
    #define SUM(a,b) a+b
    }
    
    int main(void){
       int a = 10; 
       int b = 20; 
       int c = SUM(a,b);
       int d = MUL(a,b);
       cout << c << endl;
       cout << d << endl;
       return 0;
    }
    
    
    void mul(){
    #define MUL(a,b) a*b
    }

Problem gives error with MUL macro. But runs fine with SUM macro. Why is this happening?