Tag: tutorials

How to search array elements in Java using Binary Search ?

Do you want to search for an element in a array in Java using Binary Search algorithm ? . If yes , its pretty much easy to do it using the binarySearch method exposed by the Arrays class. How to search array elements in Java using Binary Search ? Below is an example of searching an element using Binary search from array elements in Java.

C# Program to display "Hello, World!"

Problem Write a program in C# to display “Hello, World!” on the screen. C# Program to display “Hello, World!” in Console Window. This is a simple C# program that displays “Hello, World!” on the console window. Output Hello, World!

C Program to display Fibonacci Numbers

Problem Write a program in C to display the sequence of Fibonacci numbers of first n numbers entered by the user. How to display Fibonacci sequence in C Language ? Before writing a program to display the Fibonacci sequence , it is important to understand what exactly is the Fibonacci sequence. It is a series where the next number is the sum of the previous…

How to sort an array in Java ?

If you want to sort an array in Java , you can use the Arrays.sort utility method to do it. How to sort an array in Java ? Below is a sample code snippet demonstrating the usage of the Arrays.sort utility method to sort an array in java.

C Program to find if a number is odd or even using Conditional Operator

Problem Write a program in C language using the conditional operator to check whether a given number is even or odd. How to check if a Number is Odd or Even in C using conditional operator? An integer that is divisible by 2 is an even number and that is not divisible by 2 is an odd number. Example of even number is 2 ,…

C Program to check if a input number is a prime number or not

Problem Write a program in C to check whether a number is a prime number or not. How to find if a number is a prime number in C ? A Prime Number is a number that is divisible by 1 and by itself. Some of the examples of the prime number are 2 , 3 , 5 etc. Here’s a program in C demonstrating…

C Program to Swap two Numbers

Problem Write a program in C language to swap two numbers using a temporary variable and display the result in the screen. How to Swap two numbers in C using a temporary variable? Output Abundantcode – Swap two numbers using temporary variable   Enter First Number: 1                                Enter Second Number: 7                                  FirstNumber = 7.00                                   SecondNumber = 1.00

VB.NET Program to add two integers

Problem Write a program in VB.NET to add two integers and display the result on the screen. VB.NET Program to add two integers Output Enter the first number : 1 Enter the second number : 2 The sum of two numbers is:3

C Program to count the number of digits in an Integer

Problem Write a program in C to cound the number of digits in an integer that was entered by the user. How to count the number of digits in an integer in turbo C ? Output Abundantcode.com Coding sample                                                   Enter an integer: 50102                                                Number of digits: 5