Disclaimer:
Educational Use Only:
The website links provided are to be used strictly for educational and knowledge-gaining purposes only.
No Misuse:
Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.
Respect for Websites and Businesses:
Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.
Acknowledge Value of Knowledge:
Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.
No Endorsement:
The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.
User Responsibility:
By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.
Overall MCQs for Reference
- What is type conversion in artificial intelligence programming?
a. Changing data structure
b. Changing data type
c. Changing algorithm logic
d. Changing variable name
Answer: b. Changing data typewikipedia - Which function converts an integer to a float in Python?
a. str()
b. list()
c. float()
d. dict()
Answer: c. float()programiz - Type conversion where conversion happens automatically by the compiler is called:
a. Explicit
b. Implicit
c. Manual
d. Coercion
Answer: b. Implicitgeeksforgeeks+1 - Which keyword in Visual Basic forces conversion to a string type?
a. CString
b. CStr
c. ToString
d. ConvertTo
Answer: b. CStrlearn.microsoft - In C, which operator is used for explicit type conversion?
a. +=
b. cast()
c. (type)
d. reinterpret
Answer: c. (type)w3schools+1 - What is the result of int(’10’) in Python?
a. 10
b. ’10’
c. 1
d. Error
Answer: a. 10geeksforgeeks+1 - Which type conversion function cannot losslessly convert a float to int if decimals exist?
a. float()
b. int()
c. str()
d. bool()
Answer: b. int()programiz - Which function in C++ is used to overload typecast operations?
a. operator cast()
b. operator type()
c. cast operator
d. operator type
Answer: d. operator typecoursehero - What kind of type conversion occurs during division that upgrades integers to float in C?
a. Manual
b. Automatic promotion
c. Demotion
d. Truncation
Answer: b. Automatic promotionsanfoundry+1 - Which operator is used for type conversion in Python?
a. ->
b. :
c. ()
d. Constructor
Answer: c. ()geeksforgeeks+1 - Which of these is a type conversion function in AWS SiteWise SQL?
a. TO_STRING
b. TO_TYPE
c. CONVERT
d. MAKESTR
Answer: a. TO_STRINGaws.amazon - What type of error occurs when type conversion is not possible?
a. Syntax error
b. Conversion error
c. Runtime error
d. Logic error
Answer: c. Runtime errorcmu+1 - Which of the following is NOT a valid type conversion in Python?
a. int(‘abc’)
b. float(12)
c. str(10.5)
d. int(‘100’)
Answer: a. int(‘abc’)programiz - What is the type of result for float(‘5.67’) in Python?
a. Integer
b. String
c. Float
d. Boolean
Answer: c. Floatgeeksforgeeks+1 - Which Visual Basic function converts any expression to an object type?
a. CType
b. CObj
c. CastObj
d. ToObject
Answer: b. CObjlearn.microsoft - What kind of conversion is performed if the type of a value changes without an explicit operator?
a. Forced
b. Coercion
c. Explicit
d. Checked
Answer: b. Coercionwikipedia+1 - In C, what can happen if converting a larger type to a smaller type?
a. Data overflow
b. Data loss
c. Type promotion
d. Memory leak
Answer: b. Data lossgeeksforgeeks+1 - Which of these Python functions does not change type?
a. int()
b. float()
c. bool()
d. print()
Answer: d. print()geeksforgeeks+1 - Which of these is an implicit conversion?
a. Assigning integer to float variable
b. Using float() on integer
c. str(int)
d. Passing string to int()
Answer: a. Assigning integer to float variablew3schools+1 - Which keyword is used in Visual Basic to convert a value explicitly?
a. As
b. Convert
c. CType
d. ToType
Answer: c. CTypelearn.microsoft - Assigning a float to an integer variable in C using (int) keyword is an example of:
a. Implicit conversion
b. Explicit conversion
c. Unsafe conversion
d. Logical conversion
Answer: b. Explicit conversiongeeksforgeeks+1 - What will int(3.99) return in Python?
a. 3
b. 3.99
c. 4
d. Error
Answer: a. 3programiz - Which Python function converts a sequence or iterable to a list?
a. list()
b. seq()
c. tuple()
d. iter()
Answer: a. list()geeksforgeeks - In C/C++, which of these conversions is safe from data loss?
a. double to int
b. float to int
c. int to double
d. char to int
Answer: c. int to doublew3schools+1 - Which keyword is used for checked type conversion in C#?
a. checked
b. safe
c. convert
d. explicit
Answer: a. checkedwikipedia - What is the data type of str(5) in Python?
a. int
b. str
c. float
d. bool
Answer: b. strprogramiz+1 - Which Python function returns the Boolean equivalent of a value?
a. bool()
b. logical()
c. boolean()
d. Bool()
Answer: a. bool()geeksforgeeks+1 - Which type conversion function converts a number to a string in Visual Basic?
a. CNum
b. CStr
c. CVowel
d. CString
Answer: b. CStrlearn.microsoft - What is the effect of type conversion in untyped languages?
a. No effect
b. Run time coercion
c. Syntax errors
d. Increased speed
Answer: b. Run time coercionwikipedia - What does float(‘abc’) return in Python?
a. 0.0
b. Error
c. 1.0
d. None
Answer: b. Errorprogramiz - When converting int to float, what happens to the value 2?
a. Becomes 2.0
b. Remains 2
c. Becomes ‘2’
d. Causes error
Answer: a. Becomes 2.0geeksforgeeks+1 - Which process is not a conversion function?
a. toString()
b. int()
c. float()
d. addition()
Answer: d. addition()programiz - Which C++ function prototype is used to overload cast operation for int?
a. operator int()
b. cast int()
c. op_cast()
d. to_int()
Answer: a. operator int()coursehero - The process of converting ‘1’ to an integer in Python can be done by:
a. float(‘1’)
b. int(‘1’)
c. str(‘1’)
d. bool(‘1’)
Answer: b. int(‘1’)geeksforgeeks+1 - In JavaScript, what is the function to convert a string “123” to a number?
a. Number(“123”)
b. Int(“123”)
c. float(“123”)
d. Parse(“123”)
Answer: a. Number(“123”)wikipedia - Which is NOT considered a type conversion?
a. Parsing
b. Casting
c. Concatenation
d. Boxing
Answer: c. Concatenationwikipedia - In C/C++, what does conversion of int to char do to value 65?
a. Error
b. ‘A’
c. 65.0
d. None
Answer: b. ‘A’geeksforgeeks - Which is true for explicit type conversion?
a. Happens automatically
b. Needs explicit command
c. Compiler choice
d. Always safe
Answer: b. Needs explicit commandw3schools+1 - Which function can convert float to integer in Python?
a. int()
b. float()
c. str()
d. list()
Answer: a. int()programiz+1 - Which function generates ASCII character from numeric code in IBM AI conversion functions?
a. Char
b. NumToStr
c. ASCII
d. ToChar
Answer: a. Charibm - Round or truncate function, rounding -1.5 in IBM’s function returns:
a. -1
b. -2
c. 0
d. 1
Answer: b. -2ibm - Which is NOT a valid type for type conversion functions?
a. Boolean
b. Integer
c. String
d. Imaginary
Answer: d. Imaginarygeeksforgeeks - In type conversion, if coercion fails, the system typically:
a. Ignores the operation
b. Returns random value
c. Raises an error
d. Converts to bool
Answer: c. Raises an errorcmu - What happens if you apply int() to ‘3.14’ in Python?
a. 3
b. 4
c. Error
d. 3.14
Answer: c. Errorcodechef - What statement best defines coercion in programming?
a. Manual conversion
b. Data structure manipulation
c. Automatic implicit conversion
d. Coding convention
Answer: c. Automatic implicit conversiongeeksforgeeks+1 - What does str(7.89) return in Python?
a. 7
b. ‘7.89’
c. 7.89
d. ‘7’
Answer: b. ‘7.89’programiz+1 - What is true about mutable data types concerning type conversion in Python?
a. Their content can be changed
b. They are read-only
c. Type conversion is not allowed
d. They never hold data
Answer: a. Their content can be changedtestbook - Which Visual Basic function is used to convert to Decimal?
a. CDec
b. CStr
c. CInt
d. CDbl
Answer: a. CDeclearn.microsoft - Which Python function converts a value to a tuple?
a. tuple()
b. list()
c. set()
d. dict()
Answer: a. tuple()geeksforgeeks - What does bool(0) return in Python?
a. True
b. False
c. 0
d. ‘False’
Answer: b. Falseprogramiz+1
- https://en.wikipedia.org/wiki/Type_conversion
- https://www.programiz.com/python-programming/type-conversion-and-casting
- https://www.geeksforgeeks.org/c/type-conversion-c/
- https://www.w3schools.com/c/c_type_conversion.php
- https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/type-conversion-functions
- https://www.geeksforgeeks.org/python/type-conversion-in-python/
- https://www.coursehero.com/file/45178038/type-conversion-MCQdoc/
- https://www.sanfoundry.com/arduino-questions-answers-type-conversions/
- https://docs.aws.amazon.com/iot-sitewise/latest/userguide/sql-functions-type-conv.html
- https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node52.html
- https://www.ibm.com/docs/SSZJPZ_11.3.0/com.ibm.swg.im.iis.ds.parjob.dev.doc/topics/r_deeref_Type_Conversion_Functions.html
- https://www.codechef.com/practice/course/python-interview-questions/PYPREP02/problems/PYMCQ05
- https://testbook.com/objective-questions/mcq-on-data-types-and-conversion–600145cda1f01e033fa342ce
- https://www.sanfoundry.com/artificial-intelligence-questions-answers/
- https://www.tutorialaicsip.com/mcq-artificial-intelligence-class-10/
- https://www.scribd.com/document/732079608/Multiple-Choice-Questions-and-Answer1
- https://testbook.com/objective-questions/mcq-on-artificial-intelligence–5eea6a0e39140f30f369e51f
- https://kb.pigment.com/docs/data-type-conversion-functions
- https://iotmumbai.bharatividyapeeth.edu/media/pdf/ETI_22618_UT1_Question_Bank_2022-23_080323.pdf
- https://www.sciencedirect.com/topics/engineering/data-type-conversion