Home / MCQ Bank / Computer
Computer Control Flow Statements In C Sharp

What will be the output of the following C# code? static void Main(string[] args) { int temp = 1; switch (temp << 2 + temp) { default: Console.WriteLine("Example1"); break; case 4: Console.WriteLine("Example2"); break; case 5: Console.WriteLine("Example3"); break; case 8: Console.WriteLine("Example4"); break; } Console.ReadLine(); }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Example4

Related Computer Questions

Which of the following method is used to get user-specified job name? What is the value stored in t1[2] when the following code is executed? #include<stdio.h> int get_min(int a, int b) { if(a<b) return a; return b; } int minimum_time_required(int reach[][3],int spent[][4], int *entry, int *exit, int n) { int t1[n], t2[n],i; t1[0] = entry[0] + spent[0][0]; t2[0] = entry[1] + spent[1][0]; for(i = 1; i < n; i++) { t1[i] = get_min(t1[i-1]+spent[0][i], t2[i-1]+reach[1][i-1]+spent[0][i]); t2[i] = get_min(t2[i-1]+spent[1][i], t1[i-1]+reach[0][i-1]+spent[1][i]); } return get_min(t1[n-1]+exit[0], t2[n-1]+exit[1]); } int main() { int time_to_reach[][3] = {{6, 1, 5}, {2, 4, 7}}; int time_spent[][4] = {{6, 5, 4, 7}, {5, 10, 2, 6}}; int entry_time[2] = {5, 6}; int exit_time[2] = {8, 9}; int num_of_stations = 4; int ans = minimum_time_required(time_to_reach, time_spent, entry_time, exit_time, num_of_stations); printf("%d",ans); return 0; } A type whose alignment requirement is at least as large as that of every data type ______ In 1999, the Melissa virus was a widely publicised:____________? The Text and Comment is part of