int a = 10; double b = 20.0; float c = false; char d[5] = "Hello"; // here we define a string
In programming language C, the implementation of a string data
type is limited dynamic length, which means the
length of a string variable is fixed once it has been
defined.
A. True
B. False
In C# programming language, the enum variables
are NOT coerced to int. The following C# code is
invalid.
A. True
B. False
public enum Season { Spring, Summer, Autumn, Winter } public class EnumConversionExample { public static void Main() { Season a = Season.Autumn; int b = a + 1; } }
//filename demo.cpp int* p = new int[100];
Arrays can only contain elements of the same data type, while
records can contain elements of different data types.
A. True
B. False
In some programming languages, the two-dimensional arrays are
implemented column by column (column-major order), What will be the
memory block of the two-dimensional array-like?
A. A
B. B
// filename: demo.py student1 = {"name": "John doe", "gender": "M", "age": 20} student1[0]
// filename: demo.c int num1 = 10; int num2 = 20; int* p1 = &num1; // & is called address of operator, which returns the address of a variable int* p2 = &num2; p2 = p1;
The type checking must be static if the type binding must be
static.
A. True
B. False
Two data types have the structure type
equivalence if They are built in exactly the same way
using the same type constructors from the same simple types, even
the variable names and the order of the variables must be the same.
The two data types Rec1 and Rec2
defined in the following code are structurally equivalent.
A. True
B. False
struct Rec1{ char x; int y; char z[10]; }; struct Rec1{ int y; char x; char z[10]; };
char d[5]="Hello"
cannot define as primitive data type if use String there
because:-
String is non primitive data type
False
Because:
Dynamic Length Strings: Allows strings various length with no maximum. Requires the overhead of dynamic storage allocation and deallocation but provides flexibility. Ex: Perl and JavaScript
TRUE
code is invalid
because:-
we cannot explicitly cast season
C. fixed heap-dynamic
because :-
dynamic array store in heap area
TRUE
because:-
array can contain same data type where are records contain different data types
In some programming languages, the two-dimensional arrays are implemented column by column (column-major order), What will be the memory block of the two-dimensional array-like?
Answer:-
A. A
False:-
We cannot access using Student[0]
lost dynamic-heap variable
because p1 value assigning to p2
The type checking must be static if the type binding
must be static.
Answer:-
B. False
because:- the tye checking must be static if the binding must be "dynamic"
A. True
because they are equal
Get Answers For Free
Most questions answered within 1 hours.