← SAP questions
CodingReported in a candidate post, Jul 2018

Toggle 0 and 1 Without Conditionals

Filed under SAP

Write a function that takes an integer x (guaranteed to be either 0 or 1) and returns 1 if x is 0, and 0 if x is 1. You must only use basic arithmetic operations (+, -, *, /, %) without using…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related SAP questions

Collected from public candidate posts and coding forums. Updated Nov 2026.