I want to check a run time parameter is odd or even in loadrunner.
I tried the below step, but not working as expected:
if (atoi(lr_eval_string("{xxxxx}") ) & 1)
I want to check a run time parameter is odd or even in loadrunner.
I tried the below step, but not working as expected:
if (atoi(lr_eval_string("{xxxxx}") ) & 1)
It requires basic C programming skills. Below is the code which helps you in loadrunner.
if ((atoi(lr_eval_string("{xxxxx}")) % 2) == 0)
{
lr_output_message("Even Number");
}
elseif ((atoi(lr_eval_string("{xxxxx}")) % 2) != 0)
{
lr_output_message("Odd Number");
}
else
{
lr_output_message("Number is zero");
}