Computer Science MCQs With Answer by General knowledge Solutions
Computer Science MCQs With Answer by General knowledge Solutions
1) What is an array?
Ans: An array is a group of data of the same data type stored in successive storage locations.
2)How are elements of an array accessed?
Ans: Elements of an array are accessed using subscripts.
3)What is a subscript?
Ans: A subscript or an index is a positive integer value that identifies the storage position of an element in the array.
4)Which is the smallest subscript?
Ans: 0
5)How many subscripts does a one and two dimensional array have?
Ans: one dimensional array has one subscript and a two dimensional array has two subscripts( row and a column subscript).
6)Write the syntax for declaring a one dimensional array.
Ans: syntax:datatype arrayname [size];
7) Write the syntax for declaring a two dimensional array.
Ans: Syntax: datatype arrayname [row size] [column size];
8) What do you mean by initializing an array?
Ans: Initializing of an array means storing data in to an array at the design time.
9) What is a string?
Ans: A string is a sequence of one or more characters.
10) Write the syntax for declaration of a string.
Ans: syntax: char arrayname [size]; Ex: char str [100];
11) State the difference between a null character and a null sting.
Ans: A null character indicates the end of the string.
A null string is a string with zero characters or no characters.

No comments