What is the difference between static class and singleton class in c#?
Can we have private constructor in our class file. When we are trying to create instance for the class will it create or throw error regarding that?
What is int32?
What is difference between array and arraylist in c#?
Explain About disco and uddi
What is int tryparse in c#?
What does console readline do?
How can you sort the elements of the array in descending order?
What is assembly and dll in c#?
Can a class be protected in c#?
What is the role of the datareader class in ado.net connections?
hi, I am a begineer to c sharp. I have written a code for finding out prime numbers. Can anyone identify what are the flaws in my code. Kindly donot complex the code or present logic because i am new to c sharp and just started learning programming language.Thanks in advance. class Program { static void Main(string[] args) { int a,b=1; a = int.Parse(Console.ReadLine()); c= int.Parse(Console.ReadLine()); if (a % b == 0 && a % 2 != 0 && a % a == 0) Console.WriteLine(a); else if (a % b == 0 && a % 2 == 0) Console.WriteLine(a%2); Console.WriteLine("Number is not PRIME"); Console.ReadLine(); } } }
How to make a class non-inheritable other than sealed?