Call +91 8181969432 for experienced online tutor for ICSE computer application Java programming in Dubai class 6,7,8,9,10,11,12.We provide ICSE computer application tutor in Abu Hail, ICSE computer application tutor in Al Baraha,ICSE computer application tutor in Al Buteen,ICSE computer application tutor in Al Dhagaya,ICSE computer application tutor in Al Garhoud, ICSE computer application tutor in Al Hamriya Port, ICSE computer application tutor in Al Karama, ICSE computer application tutor in Al Khabisi, ICSE computer application tutor in Al Mamzar, ICSE computer application tutor in Al Mizhar, ICSE computer application tutor in Al Muraqqabat, ICSE computer application tutor in Al Murar, ICSE computer application tutor in Al Muteena, ICSE computer application tutor in Al Nahda, ICSE computer application tutor in Al Qusais, ICSE computer application tutor in Al Ras, ICSE computer application tutor in Al Rashidiya, ICSE computer application tutor in Al Rigga, ICSE computer application tutor in Al Sabkha, ICSE computer application tutor in Al Twar, ICSE computer application tutor in Al Waheda, ICSE computer application tutor in Al Warqaa, ICSE computer application tutor in Ayal Nasir, ICSE computer application tutor in Dubai International Airport, ICSE computer application tutor in Hor Al Anz, ICSE computer application tutor in Mirdif, ICSE computer application tutor in Muhaisnah, ICSE computer application tutor in Nad Al Hammar, ICSE computer application tutor in Nad Shamma, ICSE computer application tutor in Naif, ICSE computer application tutor in Port Saeed, ICSE computer application tutor in Rigga Al Buteen, ICSE computer application tutor in Umm Ramool, ICSE computer application tutor in Warisan, ICSE computer application tutor in Al Amardhi, ICSE computer application tutor in Al Bada, ICSE computer application tutor in Al Barsha, ICSE computer application tutor in Al Hamriya, ICSE computer application tutor in Al Hudaiba, ICSE computer application tutor in Al Jaddaf, ICSE computer application tutor in Al Jafilia, ICSE computer application tutor in Al Karama, ICSE computer application tutor in Al Kefaf, ICSE computer application tutor in Al Manara, ICSE computer application tutor in Al Mankhool, ICSE computer application tutor in Al Markada, ICSE computer application tutor in Al Quoz, ICSE computer application tutor in Al Rifa, ICSE computer application tutor in Al Safa, ICSE computer application tutor in Al Satwa, ICSE computer application tutor in Al Shindagha, ICSE computer application tutor in Al Souk Al Kabir, ICSE computer application tutor in Al Sufouh, ICSE computer application tutor in Al Wasl, ICSE computer application tutor in Bu Kadra, ICSE computer application tutor in Business Bay, ICSE computer application tutor in Dubai Marina, ICSE computer application tutor in Emirates Hills, ICSE computer application tutor in Dubai International City, ICSE computer application tutor in Jebel Ali, ICSE computer application tutor in Jumeirah, ICSE computer application tutor in Jumeirah Islands, ICSE computer application tutor in Jumeirah Lake Towers, ICSE computer application tutor in Nad Al Sheba, ICSE computer application tutor in Oud Metha, ICSE computer application tutor in Port Rashid, ICSE computer application tutor in Ras Al Khor, ICSE computer application tutor in Ras Al Khor Industrial Area, ICSE computer application tutor in Trade Centre 1, ICSE computer application tutor in Trade Centre 2, ICSE computer application tutor in Umm Al Sheif, ICSE computer application tutor in Umm Hurair, ICSE computer application tutor in Umm Suqeim, ICSE computer application tutor in Zabeel. Book free DEMO CLASS.
Pronic number program in Java
WAP in Java to input a number and check whether it is a Pronic Number or Heteromecic Number or not
A pronic number is a number which is the product of two consecutive integers, that is, a number of the form n(n + 1). The pronic number is also called oblong numbers, heteromecic numbers, or rectangular numbers.The first few Pronic numbers are::- 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342
Example:
30 = 5 * (5+1)
42 = 6 * (6+1)
56 = 7 * (7+1)
import java.util.Scanner; public class PronicNumber { public static boolean isPronic(int number) { int i = 0; // iterator variable // loop until square root of the number while(i <= (int)Math.sqrt(number)) { if(number == i*(i+1)) return true; // increase iterator variable by 1 i++; } return false; } public static void main(String[] args) { // declare variables int number = 0; // read the input Scanner scan = new Scanner(System.in); System.out.print("Enter an integer number:: "); number = scan.nextInt(); // check the number is Pronic number or not if(isPronic(number)) System.out.println(number+" is a" + " pronic number"); else System.out.println(number+" is not a" + " pronic number"); // close Scanner class object scan.close(); } } output: Enter an integer number:: 30 30 is a pronic number Enter an integer number:: 15 15 is not a pronic number