fork(1) download
  1. #include <stdio.h>
  2. void fun(int a,int b,int *pa,int *pb,int *pp)
  3. {
  4. *pa=a+b;
  5. *pb=a-b;
  6. *pp=a*b;
  7. }
  8. int main(void)
  9. {
  10. int a,b,add,subtract,product;
  11. puts("Enter 2 numbers: ");
  12. scanf("%i %i",&a,&b);
  13. fun(a,b,&add,&subtract,&product);
  14. printf("sum of %d & %d is %d\n",a,b,add);
  15. printf("subtraction of %d & %d is %d\n",a,b,subtract);
  16. printf("product of %d & %d is %d\n",a,b,product);
  17. return 0;
  18. }
Success #stdin #stdout 0s 2116KB
stdin
30 15
stdout
Enter 2 numbers: 
sum of 30 & 15 is 45
subtraction of 30 & 15 is 15
product of 30 & 15 is 450