if (maxmin==1)
change toif (c==1)
your problem is solve. Have a Good day
Answer from Yusuf Rıdvan SAVUT on Stack OverflowCodeforwin
codeforwin.org › home › c program to find maximum and minimum using functions
C program to find maximum and minimum using functions - Codeforwin
July 20, 2025 - Second, we need to find maximum between two numbers. Hence, the function must accept two parameters of int type say, max(int num1, int num2).
Top answer 1 of 2
1
if (maxmin==1)
change toif (c==1)
your problem is solve. Have a Good day
2 of 2
0
You should be checking if(c == 1), not if(maxmin == 1).
Your function can also be made shorter:
int maxmin(int x, int y)
{
if (x>y)
{
return 1;
}
else
{
return 0;
}
}
Also, I think your scanf is missing a comma between the two %d's.
Codeforwin
codeforwin.org › home › c program to find maximum between two numbers
C program to find maximum between two numbers - Codeforwin
July 20, 2025 - We can write expression to find maximum between num1 and num2 as num1 > num2. The expression num1 > num2 evaluate 1 if num1 is greater than num2, otherwise evaluates 0. After finding maximum, we need to execute some action based on the maximum ...
myCompiler
mycompiler.io › view › CQPGA2KSHE3
Write a C program to find maximum and minimum between two numbers using functions. (C) - myCompiler
September 15, 2022 - This comment belongs to a banned user and is only visible to admins · This comment belongs to a deleted user and is only visible to admins
Allbca
dreamstudy.allbca.com › c19.html
'C' Larger of 2 num.(by Function)
... //Find Larger of two num. using Function #include<stdio.h> #include<conio.h> int max(int a,int b); main() { int x,y; printf("Enter any two number:"); scanf("%d%d",&x,&y); max(x,y); } int max(int a,int b) { if(a>b) printf("A is greater"); else printf("B is greater"); getch(); } ... Here,we ...
myCompiler
mycompiler.io › view › CiMQGT0n5Uh
Write a C program to find maximum between two numbers using conditional operator (C) - myCompiler
This comment belongs to a banned user and is only visible to admins · This comment belongs to a deleted user and is only visible to admins
Scribd
scribd.com › document › 455070615 › FUNCTIONS
C Program for Max and Min Functions | PDF | Pointer (Computer Programming) | Matrix (Mathematics)
The document contains C program code snippets demonstrating the use of functions and pointers to perform common tasks like finding maximum/minimum, checking if a number is prime, calculating factorials, Fibonacci series, summing array elements, and more. Each code snippet is preceded by a brief description and includes main() function, other required functions, sample input/output.
Codeforwin
codeforwin.org › home › c program to find maximum and minimum element in array
C program to find maximum and minimum element in array - Codeforwin
July 20, 2025 - ... Below is the step by step descriptive logic to find maximum or minimum in array. Input size and element in array, store it in some variable say size and arr. Declare two variables max and min to store maximum and minimum.
Quora
quora.com › What-is-a-C-program-to-find-the-maximum-number-between-two-numbers
What is a C program to find the maximum number between two numbers? - Quora
Answer (1 of 12): So you have two numbers a and b, and you would like the number x which is “between” a and b, and which is the largest such number. What does “between” mean? If we suppose a
GeeksforGeeks
geeksforgeeks.org › dsa › compute-the-minimum-or-maximum-max-of-two-integers-without-branching
Compute the minimum or maximum of two integers without branching - GeeksforGeeks
June 26, 2023 - # Python3 program to Compute the minimum # or maximum of two integers without # branching # Function to find minimum of x and y def min(x, y): return y ^ ((x ^ y) & -(x < y)) # Function to find maximum of x and y def max(x, y): return x ^ ((x ...
Blogger
cprogsoutput.blogspot.com › 2012 › 04 › to-find-maximum-minimum-of-three.html
C Programs: TO FIND MAXIMUM & MINIMUM OF THREE NUMBERS
TO DISPLAY ALL PERFECT NUMBERS BETWEEN 1 TO 50 BY USING FUNCTION · #include<stdio.h> void main() { int i, sum, num; for(num = 1; num < 50; num++) { for(i = 1, sum = 0; i < num; i++) ... TO ACCEPT N NUMBERS AND DISPLAY SUM OF ALL POSITIVE & NEGATIVE NUMBERS
w3resource
w3resource.com › c-programming-exercises › c-snippets › c-program-to-define-macro-to-find-maximum-minimum-of-two-numbers.php
C – Macro to find maximum/minimum of two numbers
The main() function calls the macros with two integer values a and b, and the results are printed to the console.
Codeforwin
codeforwin.org › home › c program to find maximum or minimum using macro
C program to find maximum or minimum using macro - Codeforwin
July 20, 2025 - /** * C program to check maximum/minimum using macro */ #include <stdio.h> // Define macro to check maximum and minimum #define MAX(x, y) (x > y ? x : y) #define MIN(x, y) (x < y ? x : y) int main() { int num1, num2; // Input numbers from user printf("Enter any two number to check max and min: "); scanf("%d%d", &num1, &num2); printf("MAX(%d, %d) = %d\n", num1, num2, MAX(num1, num2)); printf("MIN(%d, %d) = %d\n", num1, num2, MIN(num1, num2)); return 0; } How to find maximum or minimum between three numbers using ternary operator?
Java67
java67.com › 2015 › 07 › java-program-to-calculate-maximum-and-minimum.html
How to calculate Maximum and minimum in Java? Beginner Tutorial | Java67
Once you got both the numbers, it just matters of using a relational operator less than and greater than to find smaller and larger numbers, as shown in the following example. After that you can Math.max() to find the maximum of two numbers, it should be the same as your earlier result. Similarly, we will ask the User to enter the number again and will display a minimum of two. Our example program has two parts.