|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
//for each function i nee the following
// function name - quick description // Inputs: describe inputs // Output: What is the return value? // Side effects: Describe the side effects, if any bool f1( unsigned long n ) { for( i=n/2; i>0; --i ) { if( n%i == 0 ) return true; } return false; } void f2( long n ) { if( n <= 0 ) return; else { cout << '*'; f2( n-1 ); } } void f3( double &n ) { n += 0.5; long i = static_cast<long>( n ) n = static_cast<double> i; } double f4( double a, double b ) { return (a+b)/2; } |
|
#2
|
||||
|
||||
|
Sounds like homework?
definately not hard either... why not give it a try... if you get stuck on a certain syntax and/or don't understand what it is, feel free to search google. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > need help fast |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|