Vishwa Bharati Public School ,Noida
Total Page:16
File Type:pdf, Size:1020Kb
Vishwa Bharati Public School ,Noida Computer Science , Class XI Arrays Short questions: 1) What are arrays? Give one example situation in which you may use arrays?
2) How is one-dimensional and 2-dimensional arrays represented in memory? Explain with suitable examples
3) How are the elements of a 1-D and a 2-D array referred ? Give examples.
4) What do you understand by the base type of an array?
5) Strings are treated as 1-D arrays in C++. Comment with examples
6) How are character arrays different from strings, if so?
7) Declare an array to store names of first 10 roll numbers of your class. Assume the names to be of 25 characters at the most.
8) Which of the following declarations will produce error and why-
a. int a[9]; b. char x[5]={‘a’,’b’,’c’,’d’,’e’,’f’}; c. float marks[2]; d. char [3][]={“Programs”,”in”,”C++”); e. int d[]={1,2,3};
9. Identify the error in following code segments:
a. #include
{
int I;
int a[6]={0,1,8,7,6,5};
for (I=0;I<15;I++)