Answered # conceptual problem

JamesCherrill 2,785 Discussion Starter gourav1 -12 JamesCherrill 2,785 Discussion Starter gourav1 -12 stultuske 1,049 Discussion Starter gourav1 -12 JamesCherrill 2,785 Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...

0

x=0xffffff0;

That's 7 hex digits, so the full value of your int, in hex is

0F FF FF F0

shifted 4 left that becomes

FF FF FF 00

ints are stored as 1 sign bit (0 = positive, 1 = negative) and 31 bits of value.

So on your 4th shift the first bit changes from 0 to 1 and the int gets interpreted as a negative number.

0

That's 7 hex digits, so the full value of your int, in hex is

0F FF FF F0

shifted 4 left that becomes

FF FF FF 00

ints are stored as 1 sign bit (0 = positive, 1 = negative) and 31 bits of value.

So on your 4th shift the first bit changes from 0 to 1 and the int gets interpreted as a negative number.

hey! please please explain it more. explain each word more properly please.

0

Sorry, that's as clear as I can make it. Just read it slowly and check any words you don't understand by looking on Google or Wikipedia

0

okay! please just explain me how is it 0F FF FF F0 ? why u include 0 at the starting of it? my exam is there please explain

0

if your exam is about to arrive, I doubt this is the first time you've had the option to study this material.

realise that an int is (normally portrayed as) decimal, that what you want is hexadecimal, take a look at the differences and see if you can find the values with the same values in decimal and hexadecimal for

0F FF FF F0

and for

FF FF FF 00

0

my second question to u is that "when i say int x=0xffffffff"(8 times f) then it prints only -1.okay why it is negative i know it. but why its value is only "1"? it should be greater than 1 means much greater than 1?

0

The value part of an int for a negative value is held in "two's compliment" form, in which ffffffff is -1 and 80000000 is the largest possible negative number. It's a bit like inverting all the 1s and 0s for negative numbers, because that makes it much easier to design the hardware for adding numbers. The full story is a bit more complicated, so here's an article that explains it in great detail

http://en.wikipedia.org/wiki/Two%27s_complement

This question has already been answered. Start a new discussion instead.

Recommended Articles

When I execute this progammatically, I get a table with row heights much larger than when I do this manually.

Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table.

```
public void AddClipboard()
{
Sel.PasteExcelTable(false,false, false);
var t = Sel.Tables[Sel.Tables.Count];
t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent);
}
```

the function that I created to find the ...