Will the following code compile?
 
private void GetValues(int a,int b, out int c,out int d) 
{ 
       d = c - a; 
       c = a + b; 
} 
private void SomeMethod()
{ 
       int a; 
       int b; 
      GetValues(1, 2, out a, out b);
}
 
Explanation
Code will not compile since variable c must be initialized before being used in d = c - a expression

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes