Blog

python tutorials and learn python

Created with Sketch.

Java program to get IP address

  Java program to get IP address Java program to print the IP (Internet Protocol) address of a computer system, we use InetAddress class of java.net package, the getLocalHost method returns InetAddress object, which represents the localhost. Java IP address program import java.net.InetAddress; class IPAddress { public static void main(String args[]) throws Exception { System.out.println(InetAddress.getLocalHost());…
Read more

Reverse a number in Java

  Reverse a number in Java Java program to find the reverse of a number, for example, if the input is 951, the output is 159. Java program to reverse a number import java.util.Scanner; class ReverseNumber { public static void main(String args[]) { int n, reverse = 0; System.out.println(“Enter an integer to reverse”); Scanner in…
Read more

Hex Color Codes and Hex colors picker

Color Picker Use the color picker by clicking and dragging your cursor inside the picker area to highlight a color on the right. Input Hex, RGB, HSL or CMYK values to search for a particular color in the fields below the color swatch; click the swatch to add it to your palette. After selecting a…
Read more

Matrix addition in Java

  Matrix addition in Java Java program to add two matrices of any order. You can modify it to add any number of matrices. Addition of two matrix in Java import java.util.Scanner; class AddTwoMatrix { public static void main(String args[]) { int m, n, c, d; Scanner in = new Scanner(System.in); System.out.println(“Enter the number of…
Read more

Transpose of a matrix in Java

  Transpose of a matrix in Java Java program to find the transpose of a matrix (of any order), we interchange its rows and columns to obtain the transpose. Matrix transpose in Java import java.util.Scanner; class TransposeAMatrix { public static void main(String args[]) { int m, n, c, d; Scanner in = new Scanner(System.in); System.out.println(“Enter…
Read more

Matrix multiplication in Java

  Matrix multiplication in Java Java program to multiply two matrices, before multiplication, we check whether they can be multiplied or not. We use the simplest method of multiplication. There are more efficient algorithms available. Also, this approach isn’t efficient for sparse matrices, which contains a large number of elements as zero. Java matrix multiplication…
Read more

Bubble sort in Java

  Bubble sort in Java Bubble sort in Java to sort numbers of an array in ascending/descending order. Bubble sort program in Java import java.util.Scanner; class BubbleSort { public static void main(String []args) { int n, c, d, swap; Scanner in = new Scanner(System.in); System.out.println(“Input number of integers to sort”); n = in.nextInt(); int array[]…
Read more

Java program to open Notepad

  Java program to open Notepad Java program to open Notepad, it’s a text editor installed in the Windows operating system and used for creating and editing text files. You may be writing Java programs in it, but you can also open it from your Java program. How to open Notepad using Java program? import…
Read more

Java programs

  Java programs Java programming: Java program consists of instructions that will be executed on a machine to perform a task. For example, say arrange given integers in ascending order. This page contains sample programs for beginners to understand how to use Java programming to write simple Java programs. These programs show how to get…
Read more

Hello world C

  Hello world C   How to write a hello world in C language? To learn a programming language, you must start writing programs in it, and this could be your first C program. Let’s have a look at the program first. #include <stdio.h> int main() { printf(“Hello world\n“); return 0; } Library function printf…
Read more