How to check all errors of Model using ASP.Net MVC
What would be the output for the following set of code static void Main(string[] args) { String obj = "hello"; String obj1 = "world"; String obj2 = obj; Console.WriteLine (obj.Equals(obj2) + " " + obj2.CompareTo(obj) ); Console.ReadLine(); }
Select the statement which should be added to the current set of code to get the output as 10 20 class baseclass{ protected int a = 20;}class derived : baseclass{ int a = 10; public void math() { /* add code here */ } }
What will be the output for the given code snippet static void Main(string[] args) { string s = " i love you"; Console.WriteLine(s.IndexOf('l') + " " + s.lastIndexOf('o') + " " + s.IndexOf('e')); Console.ReadLine(); }
Select the output for the following set of Code static void Main(string[] args) { int n, r; n = Convert.ToInt32(Console.ReadLine()); while (n > 0) { r = n % 10; n = n / 10; Console.WriteLine(+r); } Console.ReadLine(); } for n = 5432
what will be the output of code snippet?class UnsafeCode { unsafe static void Main() { char[] arr = { 'A', 'B', 'C', 'D', 'E' }; fixed (char* P = arr) { int i; for (i = 0 ;i < 5 ;i++) if (*P % 2 == 0) ++*P; else (*P)++; Console.WriteLine(arr); } Console.ReadLine(); } }
“A mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse.In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.”
Predict the output for the following set of code static void Main(string[] args) { int a = 3, b = 5, c = 1; int z = ++b; int y = ++c; b = Convert.ToInt32((Convert.ToBoolean(z)) && (Convert.ToBoolean(y)) || Convert.ToBoolean(Convert.ToInt32(!(++a == b)))); a = Convert.ToInt32(Convert.ToBoolean(c) || Convert.ToBoolean(a--)); Console.WriteLine(++a); Console.WriteLine(++b); Console.WriteLine(c); }