• 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. Pixels
  2. Hertz
  3. Megabytes
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

کمپیوٹر کا جسمانی حصہ کسے کہتے ہیں؟
  1. Software
  2. Hardware
  3. Both A and B
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

کس قسم کے ٹرمینل میں اپنا پروسیسر ہوتا ہے اور جو آزادانہ طور پر حساب کتاب اور ڈیٹا پراسیس کر سکتا ہے؟
  1. Dumb Terminal
  2. Smart Terminal
  3. Intelligent Terminal
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

سافٹ ویئر یا ہارڈ ویئر میں خرابی کو بگ کہا جاتا ہے۔ اس کے لیے متبادل کمپیوٹر جرگن کیا ہے؟
  1. Glitch
  2. Squid
  3. Slug
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

سمورغ نامی سپر کمپیوٹر کس ملک نے تیار کیا ہے؟
  1. China
  2. Japan
  3. Iran
  4. None of these
اس سوال کو وضاحت کے ساتھ پڑھیں

All Rights Reserved © TestPointpk.com