Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************
- * demonstrate how to do a divide. *
- ************************************************/
- #include <iostream>
- /************************************************
- * div -- Do a divide *
- * *
- * Returns: Result of the divide. *
- * *
- * divisor is reset to 1. *
- ************************************************/
- static int div(
- int *divisor // Pointer to the divisor
- )
- {
- int result = 5; // Divid end
- result=result/*divisor; /* Do divide */;
- *divisor=1;
- return (result);
- }
- int main()
- {
- int num = 5; // Divisor
- std::cout << "Division " <<
- div(&num) << std::endl;
- return (0);
- }
- /***********************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement