This C++ program tutorial contains the program to find divisor of a given number in C++ with complete program and code output.
// program to find the HCF or GCD of two integerslethcf;// take inputconstnumber1 =parseInt(prompt('Enter a first positive integer: '));constnumber2 =parseInt(prompt('Enter a second positive integer: '));// looping from 1 to number1 and number2for(leti =1; i <= number1 && i <...
JavaScript Code:// Function to check if a number is a happy number function happy_number(num) { var m, n; var c = []; // Continue loop until the number becomes 1 or enters a cycle while (num !== 1 && c[num] !== true) { c[num] = true; m = 0; // Calculate the sum...
Program to find sum of all digits in java importjava.util.Scanner;publicclassAddDigits{publicstaticvoidmain(Stringargs[]){// initializing and declaring the objects.intnum,rem=0,sum=0,temp;Scanner scan=newScanner(System.in);// enter number here.System.out.print("Enter the Number : ");num...
Checking Armstrong Number in Golang Problem Solution: In this program, we will read an integer number and check number is Armstrong or not, and print an appropriate message on the console screen. Program/Source Code: The source code tofind the given number is Armstrong or not using theforloo...
[Solved] How to Find 2 Largest Number from Integer... 3 Examples to convert a Map to List in Java 8 - Ex... [Solved] How to Check If a Given String has No Dup... How to Find Greatest Common Divisor of two numbers...
Enter Number : 60 Prime Factors of 60 is : [2, 3, 5] Enter Number : 1000 Prime Factors of 1000 is : [2, 5] Java Most Popular & Searched Programs »Java program to print all Java properties Java program to check whether given number is Armstrong or not ...
fmt.Printf("Given number is not palindrome") } } Output: RUN 1: Enter Number: 34543 Given number is palindrome RUN 2: Enter Number: 1235 Given number is not palindrome Explanation: In the above program, we declare the packagemain. Themainpackage is used to tell the Go language compiler ...
Java program to count all digits of an integer number using class Java program to check whether a given number is palindrome or not using class Java program to check whether a given number is armstrong or not using class Java program to add two distnace using class Java program t...
C++ Program to Count Number of Digits in an Integer. C++ Program to Reverse a Number. C++ Program to Calculate the Power of a Number. C++ Program to Check Whether a Number is Palindrome or Not. C++ Program to Check Armstrong Number. ...