+ 1

Pronic Number

1st Mar 2018, 8:34 AM
Mohammed Taquee
Mohammed Taquee - avatar
2 Answers
+ 19
submit it in comments of this assignment //no need to create a new thread for that https://www.sololearn.com/learn/4727/?ref=app
1st Mar 2018, 8:51 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 1
# include <stdio.h> # include <stdlib.h> int main() { int prno,i,n,flg; printf("\n\n Check whether a number is a Pronic Number or Heteromecic Number or not: \n"); printf(" ----------------------------------------------------------------------------\n"); printf(" Input a number: "); scanf("%d",&prno); for(i=1;i<=prno;i++) { if(i*(i+1)==prno) { flg=1; break; } } if(flg==1) { printf(" The given number is a Pronic Number.\n"); } else { printf(" The given number is not a Pronic Number.\n"); } }
1st Mar 2018, 8:36 AM
Mohammed Taquee
Mohammed Taquee - avatar