answersLogoWhite

0

The program is here guys..........

//Finding whether the given number is perfect or not

//Starts here

#include<stdio.h>

void main()

{

int i=1,temp=0,number;

scanf("%d",&number);

while(i<=number/2){

if(number%i==0)

temp+=i;

i++;

}

if(temp==number)

printf("Its a perfect number");

else

printf("Its not a perfect number");

}

//ends here

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is hypothetical real-world example using simple selection in selection control structure?

A hypothetical example could be a program that determines whether a person is eligible to vote based on their age. If the person is 18 years old or above, the program will display a message saying they can vote; if they are below 18, the program will display a message saying they are not eligible to vote.


Write a program number as a peimeter and checks whether it is perfect or not in java?

class perfect{public static void main(int n) // input as parameter{int a=0;for(int i=1;i


When you type in the SSN or EDI number and click on display you may see what message?

When you enter the SSN or EDI number and click on display, you may see a message indicating whether the information is valid or if there was an error in the input. Possible messages could include &quot;Record found,&quot; &quot;No record found,&quot; or &quot;Invalid number.&quot; Additionally, there may be prompts for further action if the information is incomplete or requires correction.


Has she seen my message but not replied yet?

It is unclear whether she has seen your message but has not replied yet.


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


What is perfect tense of fight?

The past perfect is had fought.The present perfect is has/have fought, depending on whether the subject is singular or plural.The future perfect is will have fought.


What is program icon appears regardless of whether the program is open?

pinned


Did Bach possess perfect pitch?

There is no definitive evidence to confirm whether Bach had perfect pitch.


An insurance carrier whether a private or a government program is referred to as a what?

An insurance carrier, whether a private carrier or a government program, is referred to as


How to check whether a character is numeric in an alphanumeric field in easytrieve.?

IF WS-AGE NUMERIC DISPLAY "NUMERIC" ELSE DISPLAY "NOT NUMERIC' END-IF


Is 31 a perfect number?

No. The only perfect numbers less than 100 are 6 and 28. All known perfect numbers are even - it is unknown whether there are odd perfect numbers.


Is 495 a perfect number?

No, it isn't. In fact, it is not known whether are odd perfect numbers exist. The first perfect numbers are 6, 28, 496, and 8128.