Rank: Member Groups: Registered
Joined: 18/10/2011(UTC) Posts: 16 Location: Jaipur
|
Like calculator can we check which are prime and which are not in list of prime numbers to 100 and use of these nummbers a/c to runtime .Can you tell us this ? What the cause behind that?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/07/2010(UTC) Posts: 178 Was thanked: 19 time(s) in 13 post(s)
|
Not sure what your looking for but here is a simple routine to find prime numbers between 1 and 100. Open in SMath CloudDoes anyone know how to do if without else? Edited by user 08 January 2012 05:48:49(UTC)
| Reason: Not specified |
Ed |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello Ed, If I understood you well, you are asking for "if" without "else" because you needed this structure in your example above. As far as know, there is only one "if" structure, function in SMath, - "if" with 3 arguments. We could just make "if" function with two arguments this way: Open in SMath Cloudand use it in our worksheets. The drawback of this one is that the "if" defined this way can not have a "line" structure as a second argument (not quite sure about that) although the second argument could be a function call. Open in SMath CloudI am not sure, but I think that Andrey can not make two "if" operators in programming palette. It would be a problem to distinguish them. I am not sure again, but I hope there would be possible to put if(2) and if(3) in the function list and, therefore, having both "if" structures - with and without "else". Regards, Radovan Edited by user 09 January 2012 00:04:41(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.