55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
#include <stdio.h>
|
|
#include "libs.h"
|
|
//---------------------------------------------------------------------------------------
|
|
// Exercise 4
|
|
// ----------
|
|
//
|
|
// General : The program checks for the logical results of a championship game in
|
|
// the basket ball.
|
|
//
|
|
// Input : 2 numbers (results).
|
|
//
|
|
// Process : The program checks for the logical results by conditions.
|
|
//
|
|
// Output : '1' if is it True, '0' is false.
|
|
//
|
|
//---------------------------------------------------------------------------------------
|
|
// Programmer : Cohen Idan
|
|
// Student No : None
|
|
// Date : 12.09.2019
|
|
//---------------------------------------------------------------------------------------
|
|
void main(void)
|
|
{
|
|
unsigned short result1,
|
|
result2,
|
|
difference;
|
|
BOOLEAN answer = FALSE;
|
|
|
|
printf("Enter 2 numbers: ");
|
|
scanf("%hu%hu", &result1, &result2);
|
|
|
|
difference = ABS(result1 - result2);
|
|
|
|
if (result1 <= ONE_HUNDRED_FIFTY)
|
|
{
|
|
if (result2 <= ONE_HUNDRED_FIFTY)
|
|
{
|
|
if (result1 >= FORTY)
|
|
{
|
|
if (result2 >= FORTY)
|
|
{
|
|
if (difference < SIXTY)
|
|
{
|
|
if (difference != ZERO)
|
|
{
|
|
answer = TRUE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
printf("The answer: %hu\n", answer);
|
|
}
|