Obtain Highest Occurring Character in a String Using C#

George John
Updated on 26-Jun-2020 14:33:01

4K+ Views

The highest occurring character in a string is one that occurs most number of times. This can be demonstrated using the following example.String: apples are red The highest occurring character in the above string is e as it occurs 3 times, which is more than the occurrence of any other character.A program that obtains the highest occurring character in a string using C# is given as follows.Example Live Demousing System; namespace charCountDemo {    public class Example {       public static void Main() {          String str = "abracadabra";          int []charCount = ... Read More

Selection Sort Program in C#

Chandu yadav
Updated on 26-Jun-2020 14:32:38

7K+ Views

Selection Sort is a sorting algorithm that finds the minimum value in the array for each iteration of the loop. Then this minimum value is swapped with the current array element. This procedure is followed until the array is sorted.A program that demonstrates selection sort in C# is given as follows.Example Live Demousing System; public class Example {    static void Main(string[] args) {       int[] arr = new int[10] { 56, 1, 99, 67, 89, 23, 44, 12, 78, 34 };       int n = 10;       Console.WriteLine("Selection sort");       Console.Write("Initial array ... Read More

Get Device Info in Android

Arjun Thakur
Updated on 26-Jun-2020 14:32:27

2K+ Views

This example demonstrate about How to get device info in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken a text view to show device info.Step 3 − Add the following code to java/MainActivity.xmlpackage com.example.myapplication; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.telephony.TelephonyManager; import android.widget.TextView; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.READ_PHONE_NUMBERS; ... Read More

Compare Strings for Equality in Java

karthikeya Boyini
Updated on 26-Jun-2020 14:31:46

244 Views

To compare string for equality in Java, use the equals() method. Let us see some examples wherein we have checked for same as well as different string values.Example Live Demopublic class Demo {     public static void main(String[] args) {        String one = "x";        String two = "x";        if(one.equals(two)) {           System.out.println("String one is equal to two i.e. one==two");        }else{           System.out.println("String one is not equal to String two i.e. one!=two");        }     } }OutputString one is equal to two i.e. one==twoLet us see another example.Example Live Demopublic class Demo {     public static void main(String[] args) { ... Read More

Get Device ID in Android

Ankith Reddy
Updated on 26-Jun-2020 14:30:39

1K+ Views

This example demonstrate about How to get device id in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken a text view to show device id.Step 3 − Add the following code to java/MainActivity.xmlpackage com.example.myapplication; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.telephony.TelephonyManager; import android.widget.TextView; import static android.Manifest.permission.READ_PHONE_NUMBERS; import static android.Manifest.permission.READ_PHONE_STATE; ... Read More

Insertion Sort in C#

Arjun Thakur
Updated on 26-Jun-2020 14:30:08

5K+ Views

Insertion Sort is a sorting algorithm that takes an element at a time and inserts it in its correct position in the array. This process is continued until the array is sorted.A program that demonstrates insertion sort in C# is given as follows.Example Live Demousing System; namespace InsertionSortDemo {    class Example {       static void Main(string[] args) {          int[] arr = new int[10] { 23, 9, 85, 12, 99, 34, 60, 15, 100, 1 };          int n = 10, i, j, val, flag;          Console.WriteLine("Insertion Sort");   ... Read More

Get Default SIM Serial Number in Android

George John
Updated on 26-Jun-2020 14:28:53

3K+ Views

This example demonstrate about How to get default Sim serial number in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken a text view to show device sim serial number.Step 3 − Add the following code to java/MainActivity.xmlpackage com.example.myapplication; import android.Manifest; import android.content.Context; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.RequiresApi; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; import android.telephony.TelephonyManager; import android.widget.TextView; import static ... Read More

Heap Sort in C#

Ankith Reddy
Updated on 26-Jun-2020 14:27:51

3K+ Views

Heap Sort is a sorting algorithm that makes use of the heap data structure. Each time the root element of the heap i.e. the largest element is removed and stored in an array. It is replaced by the rightmost leaf element and then the heap is reestablished. This is done until there are no more elements left in the heap and the array is sorted.A program that demonstrates heap sort in C# is given as follows.Example Live Demousing System; namespace HeapSortDemo {    public class example {       static void heapSort(int[] arr, int n) {         ... Read More

Difference Between White Box, Black Box, and Gray Box Testing

siddhartha kotamraju
Updated on 26-Jun-2020 14:26:38

1K+ Views

When you develop a web application, before hosting to the web, testing is very important to prevent the hackers. There are three types of tests, Black, gray and white box tests which are conducted to ensure that an attacker cannot reach your application code.White Box (or glass box) testingWhite Box (or glass box) testing is the process of giving input code to the system and checking how the system processes it how the output is generated using that code. This is the test where the team tests the internal logic of the code written.It is the process of checking how ... Read More

Microprocessor 8085 Architecture

Arjun Thakur
Updated on 26-Jun-2020 14:25:12

3K+ Views

Microprocessor 8085 Architecture which is shown in the below figure consists of various units and each unit has its respective functionality.Fig: 8085 Microprocessor ArchitectureThese units are listed below-AccumulatorIn Intel 8085microprocessor, accumulator acts an 8-bit register to store 8-bit data to perform arithmetic and logical operation on them. The final result stored in the accumulator. It is also called A register.Arithmetic Logic Unit (ALU)It basically performs 8-bit arithmetic operations like +, -, *, / and to perform logical operations like AND, OR, NOT etc. ALU gets inputs from the accumulator and temporary register on which it performs such operations. After processing ... Read More

Advertisements