//
//  Challenges_C
//  v.1 - 17.09.24.
//
//  For sure Internet/ChatGPT/Copilot has the solutions, 
//	Let see if you can solve it on your own
//
//
// 1) Write a fcn that swaps 2 values without intermediate variables
//    void swap2(int *a, int *b)
//
// 2) Write a 1 line fcn that select the max of 2 values without if() or ?
//    int maxNoIf(int a, int b)
//

#include <stdio.h>

// 1) -----------------------------
// Write a fcn that swaps 2 values without intermediate variables

void swap(int *a, int *b) {
// ** your code here **

   }

// 2) -----------------------------
// Write a 1 line fcn that select the max of 2 values without if() or ?

int maxNoIf(int a, int b){
// ** your code here **
}

// -----------------------------
int main(int argc, const char * argv[]) {
    {
        int a=5, b=7;
        printf("1) a = %d,      b = %d\n",a,b);
        swap(&a, &b);
        printf("   a_swap = %d, b_swap = %d\n\n",a,b);
    }
    
    {
        int x=maxNoIf(3,2);
        printf("2) maxNoIf(3,2) = %d\n\n",x);
    }
    return 0;
}
