Priority of local scope and global scope

Hello, I want to know about the priority of a local variable and global variable. Which is firstly accessed or prior by the program

hello @yashsharma4304

variables in local scope has higher priority than global scope.
example->


#include<iostream>
using namespace std;
int x=10;
int main(){

int x=20;
cout<<x;


}
output :
20

Ok thank you for clearing my doubt.