Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int add();
- int sub();
- int mul();
- int div();
- int calculate();
- int sum();
- int main(void){
- printf("Total is: %d", calculate(999999,200,mul));
- return 0;
- }
- int calculate(int x, int y, int fn()){
- return fn(x,y);
- }
- int add(int x, int y){
- return x + y;
- }
- int mul(int x, int y){
- return x * y;
- }
- int div(int x, int y){
- return x / y;
- }
- int sub(int x, int y){
- return x - y;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement