answersLogoWhite

0


Best Answer

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

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c program using while loop to accept a number check and display message whether number is perfect or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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


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


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.


What does propanganda mean?

Okay, well the actual definition I found in my dictionary here at home is "an organized program of publicity, selected information, etc." So, what that basically means is a form of getting across a message, whether it be to help or harm something, like magazines, commercials and what not that helps to widely spread your message. Quite confusing.


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.


What question drives the need for reform in the welfare program?

Whether or not the welfare program is doing its job and not being abused are questions that drives the need for reform. Also, Whether or not the program is successful in helping individuals no longer be dependent on them.


How can you know whether your visa message has been issued to air India?

ok


What is charred?

A document in this aspect is anything that holds a message, whether it's a piece of paper or a Baseball bat.Thus a charred document is a burned message.