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
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
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?
Codeforwin
codeforwin.org › home › c program to find maximum between three numbers
C program to find maximum between three numbers - Codeforwin
July 20, 2025 - Write a C program to find maximum between three numbers using ladder if else or nested if. How to find maximum or minimum between three numbers using if else in C programming. Logic to find maximum or minimum between three numbers in C program. ... In previous program we learned to find maximum between two numbers.
w3resource
w3resource.com › c-programming-exercises › function › c-function-exercise-12.php
C Program: Returns an array of maximum, minimum values
The space complexity of this function is O(1), as it only uses a fixed amount of memory to store the integer array result_mm, which has a constant size of 2. ... Write a C program to return both the maximum and minimum values from an array using pointer parameters in a function.