A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a program in C++ to check whether a number is a Pronic Number or Heteromecic Number or not
Q:

Write a program in C++ to check whether a number is a Pronic Number or Heteromecic Number or not

0

Write a program in C++ to check whether a number is a Pronic Number or Heteromecic Number or not

Sample Output:

Check whether a number is a Pronic Number or Heteromecic Number or not:                             
 ----------------------------------------------------------------------------                        
 Input a number: 42                                                                                  
 The given number is a Pronic Number

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int prno,i,n,flg;
 cout << "\n\n Check whether a number is a Pronic Number or Heteromecic Number or not: \n";
 cout << " ----------------------------------------------------------------------------\n";
 cout << " Input a number: ";
 cin >> prno;
    for(i=1;i<=prno;i++)
        {
            if(i*(i+1)==prno) 
            {
            flg=1;
            break;
            }
        }
  
            if(flg==1)
            {
            cout << " The given number is a Pronic Number."<<endl;
            }
            else
            {
            cout << " The given number is not a Pronic Number."<<endl;
            }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now