Category Archives: Java Programs Using Loops

Java Program Switch or Swap Arrays

Java Program Switch or Swap Two Arrays – In this program we will swap the given arrays a and b. How This Program Will Work? First of all we will check if the length that is size of the given two arrays is equal or not. If the size of arrays is equal then we can… Read More »

 1,539 total views,  5 views today

Python String Program To Count Vowels

Task: Write a Python String Program To Count Vowels – This python programming tutorial will explain how to find the number of vowels in a given string. The user will input the string at run time. We will use simple if statement with logical operators and comprison operators. So that we can check whether a… Read More »

 975 total views,  3 views today

Java Check Armstrong Number of N Digits Program

Task – Java Check Armstrong Number Program. This Java Programming Tutorial will explain the source code of Armstrong Number checking program. The Java program will ask you to enter an integer number (whole number). When you will enter a number, this Java Check Armstrong Number program will find whether the given number is an Armstrong… Read More »

 1,113 total views,  7 views today

Find Second Largest Number in Java Array

Task: Write a Program to Find Second Largest Number in Java Array. Do not use sorting. Use only one loop. Java Source Code To Find Second Largest Number in Java Array /* * Write a Java program to find second largest in an array with only ONE LOOP, that is without sorting. */ package secondlargest;… Read More »

 341 total views,  3 views today

Fibonacci Program in Java to print n terms

Task: Write a Fibonacci Program in Java to print n terms of Fibonacci series. The user will input the number of Fibonacci terms to print, at run time. Use Scanner class of java.util to get input from user through key board. The Source code of Fibonacci Program in Java to print n terms   /*… Read More »

 292 total views,  6 views today

Java Program to Count Digits of Number Using While Loop

Task: Write a Java Program to Count Digits of Number The source of Java Program to Count digits of a number input by the user at run time is: /* * Write a Java program to input a number and count its digit */ package countdigits; /** * @author www.EasyCodeBook.com */ import java.util.Scanner; public class… Read More »

 1,105 total views,  2 views today

Java Program To Check a Number is Prime or Composite

Task:Write a Java Program To Check a Number is Prime or Composite The Source code for Java Program to input a number and check whether it is prime number or composite /* Write a Java program to input a number and check it whether it is prime or composite number. */ package primenocheck; /** *… Read More »

 2,146 total views,  20 views today