Hello,

Problem is – User can input any number, program need to take decision based on inputs.

Let suppose input is stored in variable n;

based on value of n some function will be called.

program logic can be –

if(n > 1 && n < 10 )

callfun1();

if(n > 11 && n < 20 )

callfun2();

if(n > 25 && n < 30 )

callfun3();

if(n > 33 && n < 38 )

callfun4();

if(n > 1 && n < 10 )

callfun5();

.

.

.

and so on

if(n > minlimit && n < maxlimit )

callfunX();

Is there any easy way to avoid if else chain to do similar work.

Or is there any way to change the limits in if condition at some central place something using #define.

Please provide your inputs/help to help me finding other ways to optimize programming.

Thank

Vikas