Meeting Saved Chat

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

19:14:16 From Marvellous Infosystems : #include<stdio.

h>

int Addition(int no1, int no2)


{
int result = 0;
result = no1 + no2;

return result;
}

int Substraction(int no1, int no2)


{
int result = 0;
result = no1 - no2;

return result;
}

int main()
{
int value1 = 0, value2 = 0, ret = 0;

printf("Enter first number \n");


scanf("%d",&value1);

printf("Enter second number \n");


scanf("%d",&value2);

ret = Addition(value1, value2);

printf("Addition is : %d\n",ret);

return 0;
}
19:26:46 From Marvellous Infosystems : #include<stdio.h>

int Addition(int no1, int no2)


{
int result = 0;
result = no1 + no2;
return result;
}

int Substraction(int no1, int no2)


{
int result = 0;
result = no1 - no2;
return result;
}

int main()
{
int value1 = 0, value2 = 0, ret = 0;
// int Addition(int no1, int no2)
int (*fptr)(int,int);
// fptr is a pointer which points to the function which accepts 2 integers and
return the integer.
fptr = Addition; // fptr = 1000;
printf("Enter first number \n");
scanf("%d",&value1);

printf("Enter second number \n");


scanf("%d",&value2);

ret = fptr(value1, value2);

printf("Addition is : %d\n",ret);

fptr = Substraction;

ret = fptr(value1, value2);

printf("Substraction is : %d\n",ret);

return 0;
}

You might also like