- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2383 Articles
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
210 Views
The number for our example is 11 i.e. binary −1101The total set bits are 3 in 1101; to find it, use a loop till it’s not equal to 0. Here, our num is 11 i.e. decimal −while (num>0) { cal += num & 1; num >>= 1; }ExampleTo ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
916 Views
Let’ s say you have set the decimal to be −decVal = 34; Console.WriteLine("Decimal: {0}", decVal);Use the ToString() method for the values you get as a binary number for the decimal value −while (decVal >= 1) { val = decVal / 2; a += (decVal % 2).ToString(); ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
375 Views
Let us say the following is your string −String str = "Welcome to our website!";Create a char array of the string included above using the ToCharArray() method:char []ch = str.ToCharArray();To convert the first character to uppercase −if (ch[i] >= 'a' && ch[i] = 'a' && val[i] = 'A' && val[i] ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
11K+ Views
To check if a string is palindrome or not, you need to first find the reverse of the string using −Array.reverse()After that use the equals() method to match the original string with the reversed. If the result is true, that would mean the string is Palindrome.ExampleLet us try the complete ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
882 Views
For an Armstrong number, let us say a number has 3 digits, then the sum of cube of its digits is equal to the number itself.For example, 153 is equal to −1³ + 3³ + 5³To check for it using C#, check the value and find its remainder. Here “val” ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
759 Views
Use the Convert.ToInt32 class to fulfill your purpose of converting a binary string to an integer.Let’s say our binary string is −string str = "1001";Now each char is parsed −try { //Parse each char of the passed string val = Int32.Parse(str1[i].ToString()); if (val == 1) ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
391 Views
Let’s say your string is −str = "AMIT";To convert the above uppercase string in lowercase, use the ToLower() method −Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());ExampleThe following is the code in C# to convert character case.Live Demousing System; using System.Collections.Generic; using System.Text; namespace Demo { class MyApplication { ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
3K+ Views
The following is an example of Single Inheritance in C#. In the example, the base class is Father and declared like the following code snippet −class Father { public void Display() { Console.WriteLine("Display"); } }Our derived class is Son and is declared below −class Son ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
376 Views
C# Generics and C++ Templates provide support for parameterized types. The following are the differences −FlexibilityC++ Templates are more flexible than C# GenericsExplicit specializationExplicit specialization is not supported by C#Type ParameterThe type parameter cannot be used as the base class for the generic type in C#C# does not allow type ... Read More