C program to check whether the number is pronic number or heteromecic number or not| Rectangular number in c|E-studyblog

 In this Article, you will learn how to  check whether the number is pronic number or heteromecic number or not. A Pronic Number is a number which is the product of two consecutive number ,i.e., a number of the form n*(n+1).It is  also known as rectangular number,heteromecic number or oblong number).




C program to check whether the number is pronic number or heteromecic number or not|
C program to check whether the number is pronic number or heteromecic number or not|


Pronic Number |Heteromecic Number | Rectangular Number:


A Pronic Number is a number which is the product of two consecutive number ,i.e., a number of the form n*(n+1).It is also  known as rectangular number ,heteromecic number or oblong number .

Pronic number (n)= x*(x+1)

For Example: 6 is a pronic number 

                      2*3=6

                      2*(2+1)=6

Some Pronic numbers are 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462 … etc



C program to check whether the number is pronic number or heteromecic number or not|

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* C program to check whether the number is pronic number or heteromecic number or not */

#include<stdio.h>
#include <stdlib.h>

int main(){
	int i,n,p,flag=0;
	printf("Enter an Integer:");
	scanf("%d",&p);
	for(i=1;i<=p;i++)
	{
	if(i*(i+1)==p)
	{
	flag=1;
	break;
        }
        }
        if(flag==1)
        {

	printf("\n The number is  a pronic number:");
        }
        else
	{
        printf("\n The  number is   not a pronic number:");
	return 0;
}
}

Output:

C program to check whether the number is pronic number or heteromecic number or not| Rectangular number in c|E-studyblog

C program to check whether the number is pronic number or heteromecic number or not| Rectangular number in c|E-studyblog

       

I hope you have read our Article C Program to check whether the number is pronic number or heteromecic number or notand  you have collected lots of information from there. If you like the post, then please comment and share among your friends and family. you can write your opinion about my post in the comment box. 


Thank you!

No comments:

Post a Comment

If you have any queries ,please let us know

C Program to Check whether the number is Even or Odd|how to find odd and even numbers in c programming|E-studyblog

I n this Article, you will learn how to   Check  whether the number is  Even or odd. We have shared the source code of odd and even number i...