سلااااااااااااااااااااام
الله يعااااااااااااااااااااااافيكم ابغى حل لهذه البرامج ضروري وقبل يوم السبت ضروري وشكرا
Write program with the following functions
:
bool prime (int);
that returns true if parameter is divisible only 1 and by itself.
bool perfect (int);
That returns true if parameter is perfect integer :if the sum of its factors including 1(but not the number itself )is equal to the number .
Int GCD (int,int); //seen in the first Lab
These functions are invoked in the main function .Here two integers are read and only necessary functions are called (not always all).
*****************************************
Bonus
Write a program with the following steps:
Read an integer.
Outputs this integer with its digits reversed.
EX: input=1427 Output=7241
***************************************
Write C++ statements that performs the specific task .Each question should use the result of the previous one .
1-Declare an array NUMBER of 10 double elements ,and
initialize it to 0.0,1.1,……9.9
2-Declare a pointer nptr to point to a double value.
3- Print array number 'using subscript notation.
4-Write two separate statements that each assign the starting
address of NUMBEFR to nptr.
5- Print elements of NUMBER using pointer /offset notation with nptr.
Pointer /offset notation with array name ،، ،، ،، ،، ،،6-
Pointer /subscript not،، ،، ،، ،، ،،7-
8- Verify how many bytes your compiler allocates to double variables.
9- Assume that nptr points to the beginning of the array , what address is referenced by nptr+8 ? what is its content ?
******************************************