- 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
Samual Sam has Published 2492 Articles
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
393 Views
For the upper triangular matrix, set all the elements below the main diagonal to zero.Set the following condition −if (i = j) Console.Write(A[i, j] + "\t"); else Console.Write("0\t"); } } Console.ReadLine(); } }OutputEnter number of rows and columns of the matrix Enter elements: Upper Triangular Matrix
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
4K+ Views
To work with threads, add the following namespace in your code −using System.Threading;Firstly, you need to create a new thread in C# −Thread thread = new Thread(threadDemo);Above, threadDemo is our thread function.Now pass a parameter to the thread −thread.Start(str);The parameter set above is −String str = "Hello World!";ExampleLet us see ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
7K+ Views
Basic Arithmetic Operators in C#, include the following −OperatorDescription+Adds two operands-Subtracts the second operand from the first*Multiplies both operands/Divides the numerator by de-numerator%Modulus Operator and remainder of after an integer division++Increment operator increases integer value by one--Decrement operator decreases integer value by oneTo add, use the Addition Operator −num1 + ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
To split and join a string in C#, use the split() and join() method. Let us say the following is our string −string str = "This is our Demo String";To split the string, we will use the split() method −var arr = str.Split(' ');Now to join, use the join() method ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
433 Views
To create a thread, I have created a function −public void myThread() { for (int i = 0; i < 3; i++) { Console.WriteLine("My Thread"); } }The above function is called to create a thread and a new ThreadStart delegate is created −Demo d = ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
11K+ Views
Our sample string is −myStr = "Tom";To reverse the string, firstly find the length of the string −// find string length int len; len = myStr.Length - 1;Now, use a while loop until the length is greater than 0 −while (len >= 0) { rev = rev + myStr[len]; ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Let’s say the following is the string −Hello WorldAfter reversing the string, the words should be visible like −olleH dlroWExampleUse the reverse() method and try the following code to reverse words in a string.Live Demousing System; using System.Linq; class Demo { static void Main() { // ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
247 Views
The sleep method of the thread is used to pause the thread for a specific period.If you want to set sleep for some seconds, then use it like the following code snippet −int sleepfor = 2000; Thread.Sleep(sleepfor);ExampleYou can try to run the following code to implement the sleep method of ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
7K+ Views
You need to check for both the vowels and consonants, but do not forget to check for both the uppercase as well lowercase.For counting vowels, check for “aeiou” characters separately i.e.if (myStr[i] == 'a' || myStr[i] == 'e' || myStr[i] == 'i' || myStr[i] == 'o' || myStr[i] == 'u' ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
302 Views
Actually, MySQL NOT NULL constraint restricts a column of the table from having a NULL value. Once we applied NOT NULL constraint to a column, then we cannot pass a null value to that column. It cannot be declared on the whole table i.e., in other words, we can say ... Read More