Java Programming Code Examples
Java > Java2D Code Examples
C++ Codings Shutdown Computer System -
To shutdown and restart you computer using C++, just call the function system() of stdlib.h library which will call the cmd or terminal. So to shutdown and 'restart your computer', just
Implement Interpolation Search algorithm -
Implement 'Binary search' using interpolation approach. The Time complexity is "O(log(n))". Implement the Binary Search on sorted array. Then Calculate mid value using 'interpolation'
C++ Language Break Continue Statement -
We can use "break" statement inside loops to terminate a 'loop & exit' it. In above example loop execution 'continues' until either n>=20 or entered score is negative. This statement
C Program to Find Sum of Array Elements -
Find Sum of Array elements Using Recursive function in C language. Function declaration to find sum of array. Input size and elements in array. Recursively find the sum of elements
Program Compare two Strings by Pointers -
C program to compare two strings using loop character by character. Logic to compare two strings. Input "2 strings" from user. Store it in some variable say str1 and str2. Compare two
Find Sum of First & Last digit of a number -
C program to input a number and find sum of first & last digit of the number using for loop. Input a number from user and store it in some variable say j. Find last digit of given number
Find Armstrong number in C++ Language -
In math, A number in which the sum of cube of its individual digits is equal to the number itself is called Armstrong number. 1^3 + 5^3 + 3^3 = 153. To make logic firstly concept about
Code to Self Balancing Binary Search Tree -
Make the "Tree Logically" empty, insert data and get "height of node". Function to max of left/right node, insert data recursively. Rotate binary tree node with left child. Rotate binary