adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

program in c to return more than one value from the function

program in c to return more than one value from the function


#include<stdio.h>
#include<conio.h>
  void Fun(int a,int b,int *,int *,int *);
  int main()
   {
       int x,y,sum,dif,mul;
       printf("Enter two numbers:-");
       scanf("%d%d",&x,&y);
       fun(x,y,&sum,&dif,&mul);
       printf("Sum = %d \nDifference = %d\nMultiplication = %d",sum,dif,mul);
       getch();
       return 0;
   }
  void fun(int a,int b,int *s,int *d,int *m)
    {
       *s=a+b;
       *d=a-b;
       *m=a*b;
    }

Output :-



Post a Comment

0 Comments