English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Are any of the following expressions illegal? What is the numerical value of each? As evaluated by the C# language

A.) 2.2 * 104
B.) 6.8 - 2
c.) 24.0 / 6.0
D.) 7.0 % 3.0
E.) 9 % 2.0

2006-11-22 10:19:59 · 7 answers · asked by Sad Mom 3 in Computers & Internet Programming & Design

7 answers

I'm guessing that D and E are illegal as modulous involves integers.

A) 228.8
B) 4.8
C) 4.0
D) Illegal, but if it were legal: 1 (remainder of 7/3)
E) Illegal, but if it were legal: 1 (remainder of 9/2)

2006-11-22 14:01:43 · answer #1 · answered by chemicalimbalance000 4 · 1 0

They are all legal, and they will all return type Double. If you need more help for anything similar, you can find a powerful C# expression calculator here:
www.simplestsolutions.net/code-calculator.html
It's been designed espesially to help novices come to terms with C# expressions

2014-10-05 09:40:38 · answer #2 · answered by Anonymous · 0 0

They are all legal. write a program to see the results. Do your own homework, kids.

2006-11-22 19:30:21 · answer #3 · answered by WickedSmaht 3 · 0 0

I don't think b will work.
I would suggest making a small little program to test them.

2006-11-22 18:42:22 · answer #4 · answered by scott p 3 · 0 0

depends on the data type. mixing floats and ints variables will cause errors

2006-11-22 18:22:52 · answer #5 · answered by ... 3 · 0 0

c d e are illegal i think

2006-11-22 18:21:01 · answer #6 · answered by Best Helper 4 · 0 0

I think all are right...

2006-11-22 18:22:35 · answer #7 · answered by Sundu4u 2 · 0 0

fedest.com, questions and answers