1. Which of the following is a collection of different data types?
A. String
B. Structure
C. Array
D. None of these
(b)
2. In C, if you pass an array as an argument to a function, what actually gets passed?
A. Value of elements in array
B. First element of the array
C. Base Address of the array
D. Address of the last element of array
(c)
3. Are the expressions arr and &arr same for an array of 10 integers?
A. True
B. False
(b)
4. Where the local variables are stored?
A. Stack
B. Heap
C. Disk
D. None of these
(a)
5. Print the output of following code :
main()
{
if(-1)
printf(“True”);
else
printf(“False”);
}
A. True
B. False
C. True False
D. Error
(a)
Ans 70 will be int. Remember return 0. Here 0 is int
Dear Anish,
If a return value isn’t required, declare the function to have void return type. If a return type isn’t specified, the C compiler assumes a default return type of int. In a main function, the return statement and expression are optional.