- using System;
- namespace HelloWorld
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i = 15;
- const string string1 = "Foo";
- const string string2 = "Bar";
- if(i > 10)
- {
- string result = string1;
- }
- else
- {
- string result = string2;
- }
- Console.WriteLine(result);
- }
- }
- }
Loading
Jignesh KumarPosted Nov 29, 2018, 9:30 AM
You have created local variable string result and tring to use out Side thats why you are not able to get that variable.