Computer Project For Class XI

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Acknowle

dgement
I  would like to express my special thanks of
gratitude to my teacher Mr. Atul Kumar
Sinha as well as our Senior Principal Ms.
Jyoti Kashyap and Principal Ms Shivani
Singh who gave me the golden opportunity
to do this wonderful Computer project which
also helped me in doing a lot of Research and
I came to know about so many new things I
am really thankful to them.

Secondly I would also like to thank my


parents and friends who helped me a lot in
finalizing this project within the limited time
frame.
.

Computer Project
Name:………………..….

Class:……Sec…..

Internal Examiner’s
sign:
___________________
External Examiner’s
sign:
____________________

Index
S.No. Program Page No.
P1 Special Factorial Number
P2 Special Two Digit Number
P1

P2
P3

P4 Goto Top
P5 Goto Top

P6 Goto Top
P7 Goto Top
P8 Goto Top

P9 Goto Top
P10 Goto Top

P11 Goto Top


P12 Goto Top

P13 Goto Top


P14 Goto Top

P15 Top
A Friendly number is a number the eventual sum of the digits of the number is equal to 9.
For Example: 675 = 6 +7+5 = 18
18 = 1+ 8 = 9
As the final sum of the digits of the number 675 is 9 so it is a Friendly number. Some more
Friendly numbers can be 9, 18, 54, 243 etc.
Design a class Friendly to check if a given number is a Friendly number or not. Some of the
member functions of the class are given below.
Class name : Friendly
Data member
Num : to store the number

Member Functions
Friendly ( int n) : to assign value of n to Num

int sumOfDigits(int nn) : Returns the sum of the digits

boolean isFriendly( int x ) : returns true if the number is Friendly by calling


the function sumOfDigits(int) otherwise returns false.

void display() : display appropriate message “Number is a


Friendly number” OR “Number is not a Friendly
number” by calling the function isFriendly(int)

Write the main( ) function to create object for the class and call functions.

You might also like