Computer Science, asked by tanishka1586, 10 months ago

write a program to find mimimum of two numbers using subroutine​

Answers

Answered by divya772585
1

Answer:

0

down vote

favorite

C Program to find maximum and minimum between two numbers using functions

c function recursion max min

I was solving a code of maximum and minimum using functions. I wrote the code like this:

#include <stdio.h>

int maxmin(int x, int y);

int main () {

int a, b, c;

scanf("%d%d", &a, &b);

c = maxmin(a, b);

if (maxmin == 1) {

printf("%d is maximum,%d is minimum", a, b);

}

else

printf("%d is maximum,%d is minimum", b, a);

return 0;

}

int maxmin(int x, int y) {

int XisMax = 0;

if (x > y) {

XisMax=1;

}

else {

XisMax=0;

}

return XisMax;

}

Similar questions