How to identify even or odd numbers along with best practices of Ui path.
Thanks and regards from our
i want to get the input from myself each time i want to give different numbers
How about the following?
Or If you want to give multiple numbers then try below
Or If you are having an array of numbers then try below
Regards,
1 Like
Welcome to Community!!
To achieve your process, follow the below methods,
- Use Input dialogue box to get the Input from your side/any user, store it in the string variable
- Check the that user input is number or not for that you can use this expression in if condition(isnumeric(strUserInput))
- In Then sequence convert that string to int for that take one assign activity, create one int var and provide that input in To section and in value use Cint(strUserInput)
- after assign acitivty use one more if activity to check given number is Even or odd for that use intVar mod 2 =0
- in then, print a log message stating that given input was Even Number
- in else condtion, use one more log message activity stating that given number is Odd Number.
3.In Else Branch, Use a log message that given input was not in correct format.
If you are familiar with try catch you can implement this in Try catch activity.
Happy Automation!!
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.



