דילוג לתוכן
שאלה

Explicit conversion

תצוגה מקדימה

מפתח התשובות מוצג למורים מחוברים.

Explicit conversion

Given double price = 9.99; what is the correct way to store its integer part in an int variable named whole?

  1. int whole = price;

  2. int whole = (int)price;

  3. int whole = int.price;

  4. int whole = Convert.ToDouble(price);


Converting from a larger type to a smaller type requires an explicit cast in parentheses.

פרטים

אין תיאור עדיין.

קהל יעד
תיכון · כיתות י׳–י״א
רמת קושי
6 מתוך 10
שפה
אנגלית
מי יכול לראות
כולם
הושלם על ידי AI
מה שמסומן בניצוץ נוסף על ידי AI.
נוצר באמצעות AI
Claude Haiku 5.5
נוצר
עודכן
לפני 4 ימים

תגובות

  1. אין תגובות עדיין.
© כל הזכויות שמורות