NEW
Font size
WorksheetsComputer Programming (Lab)
Total questions: 10
Worksheet time: 5mins
What is an Array in C language.?
A group of elements of same data type.
An array contains more than one element
Array elements are stored in memory in continuous or contiguous locations.
All the above.
Choose a correct statement about C language arrays.
An array address is the address of first element of array itself.
An array size must be declared if not initialized immediately.
Array size is the sum of sizes of all elements of the array.
All the above..
What are the Types of Arrays.?
int, long, float, double
struct, enum
char
All the above...
An array Index starts with.?
-1
0
1
2
An entire array is always passed by ___ to a called function.
Call by value
Call by reference
Address relocation
Address restructure
What is a String in C Language.?
String is a new Data Type in C
String is an array of Characters with null character as the last element of array.
String is an array of Characters with null character as the first element of array
String is an array of Integers with 0 as the last element of array.
Choose a correct statement about C String.
char ary[]="Hello..!";
Character array, ary is a string.
Array has no Null character at the end
String size is not mentioned
String can not contain special characters.
What is the Format specifier used to print a String or Character array in C Printf or Scanf function.?
%c
%C
%s
%w
What is the output of C Program with Strings.?
int main()
{
char ary[]="Discovery Channel";
printf("%s",ary);
return 0;
}
D
Discovery Channel
Discovery
Compiler error
What is the output of C Program with Strings.?
int main()
{
char str[]={'g','l','o','b','e'};
printf("%s",str);
return 0;
}
g
globe
globe\0
None of the above...
