0 0 votes https://gateoverflow.in/45555/c-programming-predict-the-output main() { { extern int i; int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i; rude explained how output is printed but its giving error when i'm trying to run the program here https://ideone.com/xteXgV Programming in C programming-in-c output + – Mk Utkarsh 1.4k views answer comment Share Follow Print See all 9 Comments 9 9 Comments reply Show 6 previous comments Shubhgupta commented Nov 10, 2018 reply Follow flag yes correction is needed for that question. 0 0 replyShare Somoshree Datta 5 commented Nov 16, 2018 reply Follow flag Mk Utkarsh When we declare a variable as extern, its a promise to the compiler that the definition of that variable will be at some other place in global scope and not in the same block in which the variable is declared as extern. So when u try to define the variable in the same block in which it is declared, it will result in compile time error as its a local variable and it wont fulfill the promise made to the compiler since local variables are invisible to linkers. Am i correct? 1 1 replyShare Mk Utkarsh commented Nov 16, 2018 reply Follow flag Somoshree Datta 5 i also believe the same 0 0 replyShare Please log in or register to add a comment.