hi there ! im new to programming , i cant figured out how to determine the highest even number and the lowest odd number among three numbers in C . does anyone out there have an idea ? i badly need your help . tnx in advance :)))

Recommended Answers

All 5 Replies

So do you know (for example) how to tell if a number is even or odd?

Do you know how to arrange 3 numbers in order, ignoring the even/odd part of the problem?

yup I already know about that , my problem is how to find the highest even and lowest odd in one program .

here's my code . but its not workng

#include <stdio.h>
#include <conio.h>

void main ()
int iNum1,iNum2,iNum3,iNum,low,high;
printf("Enter three integers\n");
scanf("%d %d %d",&iNum1,&iNum2,&iNum3);
high = iNum1;
else if(iNum2>iNum3)
high = iNum2;
high = iNum3;
printf("\nThe highest even integer is: %d",high);}
low = iNum1;
else if(iNum2<iNum3)
low = iNum2;
low = iNum3;
printf("\nThe lowest odd integer is: %d",low);}

Here are the problems I see:
#include <conio.h> - non-standard, useless in your case
void main () - see this
clrscr() - old, non-standard, useless in your case
getch() - non-standard, use a standard C function like getchar() formatting - non-existent, see this
And lastly, telling us "it's not working" and making us try to figure out how it's not working. And explanation of how you can tell would be nice, like what numbers you enter and what answers you get. Something useful...

Further, what does
have to do with iNum1, iNum2 or iNum3 (the 3 values you read in).

Are you allowed to use arrays for this problem?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.