• Call Us : 03082533000 (WhatsApp)
  • Email Us : TestPointpk.com@gmail.com
Sticky Note
Suppose z is an integer while z and y are long variables. If you write z = z + y; in your C program, which of the following will happen?
  1. Compiler will generate error
  2. z will be converted to long and z will be calculated as long
  3. y will be converted to int and z will be calculated as int
  4. z will be converted to long and z will be calculated as int
Explanation

In z = z + y;, since z is an int and y is long, y is converted to int (if possible) to match the type of z due to usual type conversion rules.

The result is calculated as an int, and this may cause data loss if y exceeds int range.

Related MCQs

کون سا آپریٹنگ سسٹم ملتے جلتے کاموں کو گروپ بنا کر بیچز کی صورت میں چلاتا ہے؟
  1. Real-time operating system
  2. Batch operating system
  3. Distributed operating system
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

کمپیوٹر کے مدر بورڈ پر سی ایم او ایس بیٹری کا کیا کام ہے؟
  1. To power the processor
  2. To maintain system time and BIOS/UEFI settings
  3. To increase internet speed
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

درج ذیل میں سے کون سی آپٹیکل اسٹوریج ڈیوائس کی مثال ہے؟
  1. SSD
  2. DVD Drive
  3. Hard drive
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

جی این یو آپریٹنگ سسٹم کا منصوبہ کس نے شروع کیا؟
  1. Bill Gates
  2. Steve Jobs
  3. Richard Stallman
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

مندرجہ ذیل میں سے کون سی غیر مستحکم میموری ہے؟
  1. RAM
  2. ROM
  3. Cache
  4. Both A and C
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com