Assign values to int array in c#

Hello All,

Hope everyone doing well here!

I’m beginner for this UIPath and practicing some examples with c# code.

I have seen some example to Find the smallest and biggest numbers in an Array in vb.net code in UIPATH academy. I’m converting it to c# code but its not working and showing error(Screenshot attached).

Anyone have any idea hot to resolve this? This is correct c# syntax but its showing ; and } is expected.

Thanks for your help.

@Deenu
give a try on: new int[] { 99, 98, 92, 97, 95};

1 Like

Thanks PPR. I have no idea to include new int because i have watched this tutorial in vb.net.

just give a try with only { 99, 98, 92, 97, 95}; but ensure the closing ;

we can play with statements while debugging and working with the watch / immediate panel
(good course on this within the academy)
or here: https://dotnetfiddle.net/ (changed to script type)

1 Like

{ 99, 98, 92, 97, 95}; - If added this alone without “new int” is not working expression panel but if we add like below, its working fine.

new int { 99, 98, 92, 97, 95};

Sure I will use and ensure my expression through dotnetfiddle.net !! Thanks!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.