26 lines
875 B
C
26 lines
875 B
C
#define APPLE_COUNT 10
|
|
#define APPLE_COST 5
|
|
#define TWO 2
|
|
//---------------------------------------------------------------------------------------
|
|
// Exercise 4
|
|
// ----------
|
|
//
|
|
// General : The program calculates what is the cost for bananas and apples.
|
|
//
|
|
// Input : None.
|
|
//
|
|
// Process : The program calculate price by multiply and amount.
|
|
//
|
|
// Output : None.
|
|
//
|
|
//---------------------------------------------------------------------------------------
|
|
// Programmer : Cohen Idan
|
|
// Student No : None
|
|
// Date : 09.09.2019
|
|
//---------------------------------------------------------------------------------------
|
|
void main(void)
|
|
{
|
|
unsigned char bananas = APPLE_COUNT + TWO;
|
|
unsigned short sum_cost = (APPLE_COUNT * APPLE_COST) +
|
|
(bananas * APPLE_COST * TWO);
|
|
} |