interview help in bpo`s

Pages

  • Home
  • bpo books
  • BPO Interview Tips and BPO interviews Questions & ...

Wednesday, September 1, 2010

a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant.

#include
#include
int f(int x)
{ int i,c,a=0;
for(i=1;ix)
printf("\nthis number is abundant");
if(f(x) printf("\nthis number is deficient");
getch();
}
Posted by sameer at 3:58 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: programing

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Infolinks In Text Ads

Followers

Blog Archive

  • ▼  2010 (44)
    • ►  November (13)
    • ▼  September (19)
      • No title
      • No title
      • What is Pure Virtual Function? Why and when it is ...
      • What will happen if when say delete this ?
      • How much is size of struct having 1 char & 1 integer?
      • why v use c++ even we have microprocessor?
      • What is the difference between reference type and ...
      • When is the last time you coded in C/C++? What is ...
      • Write a String class which has: 1) default constru...
      • What are the advantages of C++ programming compare...
      • What is the difference between a copy constructor ...
      • why all c++ program must have default constructor?
      • a number is perfect if it is equal to the sum of i...
      • Write a program that takes a 5 digit number and ca...
      • What is OOPS and How it is different from Procedur...
      • What is the expansion of OOPS?
      • programing interview question part1
      • No title
      • Beauty of Love: this place is make for lovers
    • ►  August (1)
    • ►  July (11)

About Me

sameer
View my complete profile
Picture Window theme. Powered by Blogger.