
- Forum
- Programming Talk
- C and C++
- I need shortest sourcecode
I need shortest sourcecode
This is a discussion on I need shortest sourcecode within the C and C++ forums, part of the Programming Talk category; Can anyone help me please, " How can i find greatest or smallest number among two numbers without using relational ...
-
11-06-2011, 01:32 AM #1
- Join Date
- Nov 2011
- Answers
- 1
I need shortest sourcecode
Can anyone help me please, " How can i find greatest or smallest number among two numbers without using relational operator? "
-
02-21-2012, 04:58 AM #2
- Join Date
- Feb 2012
- Answers
- 66
Here is a program to find the greatest of 2 numbers without using relational operators.
void main()
{
float a,b;
int n;
printf("Enter 2 numbers:");
scanf("%f,%f",&a,&b);
n=a/b;
if(n)
printf("%f is greater",a);
else
printf(%f is greater",b);
}
«
Incrementation and decrementation in C
|
Difference Between Normal Executable Statement and Printf Statement
»

Reply With Quote





