#include<stdio.h>
#include<conio.h>
void calc(int *,int *);
void main()
{
int no1,no2;
clrscr();
printf("enter 1st number: ");
scanf("%d",&no1);
printf("enter 2nd number: ");
scanf("%d",&no2);
calc(&no1, &no2);
getch();
}
void calc(int *a, int *b)
{
printf("\n\naddition : %d",*a + *b);
printf("\nsubtraction: %d",*a - *b);
printf("\nmultiplication: %d",*a * *b);
printf("\ndivision: %d",*a / *b);
}
/* output:
enter 1st number: 10
enter 2nd number: 5
addition : 15
subtraction: 5
multiplication: 50
division: 2
*/
No comments:
Post a Comment