Please tell me Why the following code is giving output as -25536

visual studio 2008 , csharp , windows xp India
  • 8 years ago

    Please tell me why the following code is giving output as -25538

    int num = 40000; short snum; sunm = (short) num;

  • 8 years ago

    The Blu Ray DVD is very common now, but there is a problem going with it, which is how we can enjoy the Blu Ray DVD on our mobile devices such as PSP, iPhone or Zune? So here I want to introduce a powerful tool, which is Aiseesoft [b][url=]Blu Ray Ripper[/url][/b], it can not only [b]rip Blu Ray DVD, but also common DVD[/b].


    Key Functions 1.[b]Rip Blu Ray to video formats[/b] With advanced blu ray decoding technology, Aiseesoft Blu Ray Ripper can convert/rip Blu ray into HD or general-format video files. HD videos: HD H.264, HD AVI, HD MPG, HD TS, HD WMV, HD MPEG 4, HD MOV, HD ASF SD videos: MPEG-4, H.264/MPEG-4 AVC, MOV, M4V, AVI, 3GP, FLV, SWF, MKV, etc 2. [b]Blu Ray audio converter[/b] You can also extract audio from blu ray discs and convert them into popular audio files: AAC, AC3, AIFF, AMR, AU, FLAC, MP3, M4V, MP2, OGG, WAV, WMA. 3. [b]Preview and capture picture[/b] The program supports to capture the snapshots images and save them as JPG, GIF, and BMP formats when previewing Blu Ray movie.

    Key Features 1.[b]Trim, Crop and Merge[/b] With crop, you can cut off unwanted area easily. Obtain any clips you want with trim and merge selected contents into one file by checking "Merge into one file" option. 2.[b]Set output video effect and add watermark[/b] Improve video quality by manually adjusting display brightness, contrast and saturation you can even add watermark in Text or Image to individualize your video. 3.[b]Adjustable output parameters[/b] Aiseesoft Blu Ray Ripper provides more specific video and audio output settings for you to adjust, such as video Encoder, Resolution, Frame Rate, Bitrate and audio Encoder, Sample Rate, Channel, Bitrate. Well-customized settings can be saved as user-defined for convenience. 4. [b]Intuitive and easy to operate[/b] Its interface is streamlined and intuitive. You will have no problem to find any options.

  • 8 years ago

    I think the output should be -25536.

    Short integer --> 16 bits --> -32768 - 32767 When the value is 40,000. After 32767, it starts moving from -32768 towards 0.

    40000 - 32767 = 7233. -32768 + 7233 - 1(the position will be one less) = -25536

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Computer Science is no more about computers than astronomy is about telescopes.” - E. W. Dijkstra