Q.20 When an array is passed to a function, it can said that is passed
(a)Address of the array
(b)Value of the first element of the array
(c)Address of the first element of the array
(d)Number if elements in the array
Q.21 Find the output of the following program?
#include
void main()
{
char *str=”:ello word”
printf(“%s” str)
}
(a)Hello world
(c)Garbage value
(b)Error
(d)None of the above
Q.22 Find the output of the following program?
#include
void main()
{
int array[]={10,20,30,40};
printf(“%d” -2[array);
}
(a)-60 (b)-30
c)Garbage value (d)compile error
Q.23 Find the output of the following program?
#include
void main()
{
int i=10;
static int x=10; if(x==i) printf(“Equal”) else
printf(“Less than”)
}
(a)Equal
(c)Less than
(b)Greater than
(d)None of the above
Q.24 Find the output of the following program?
#include<stdio.h>
void main()
{
char str*+=”C-program”
int a=5;
printf(a 10?“Ps\n” ”%s\n” str)
}
(a)C-program
(c)Error
(b)Ps
(d)None of the above
Q.25 It is compulsory to write the return type for every function
(a)True (b)False
Q.26 The return type of a function cannot be
(a)void
(c)int
(b)main
(d)float
Q.27 Every program must have atleast function(s)
(a)1 (c)3
(b)2
(d)None of the above
Q.28 The function with the name is always written in every program
(a)int
(c)main
(b)void
(d)factorial
Q.29 Every function must contain minimum of arguments passed to it
(a)1 (c)3
(b)2
(d)None of the above
Q.30 In the function definition, the argument list must always be accompanied with the corresponding
data type
(a)True (b)False
Q.31 The function name follows the rules of the identifier
(a)True (b)False
Q.32 A void return type for a function indicates that
(a)The function cannot return any data
(b)The function can return any type of data
(c) The function can return any type of data except for “int”
(d)None of the above
Q.33 The value returned by a function is returned to the
(a)main function
(c)caller function
(b)Operating System
(d)called function
Q.34 A function that does not return any data is called as function
(a)int
(c)float
(b)void
(d)recursive
Q.35 Argument list is a list of parameters that the has to pass to the function
(a)main function
(c)caller function
(b)Operating System
(d)called function
Q.36 The parameters passed by the caller function are called as the parameters
(a)actual
(c)informal
(b)formal
(d)reference
Q.37 The parameters received by the called function are called as the parameters
(a)actual
(c)informal
(b)formal
(d)reference
Q.38 The number of actual and formal parameters
(a)can be different
(c)should be the same
(b)should not be the same
(d)cannot be same
Q.39 The datatype of actual formal parameters
(a)can be different
(c)should be the same
(b)should not be the same
(d)cannot be same
Q.40 The prototype declaration is required when
(a)calling any function
(b)calling a function which is defined before it is called (c)calling a function which is called before it is defined (d)None of the above
Q.41 The prototype of a function can be written
(a)only outside a function
(b)only inside a function
(c)both inside and outside a function
(d)only with prefix’#’
Q.42 The prototype of a function should contain the data type of the parameters to be passed to that
function
(a)true (b)false
Q.43 The prototype of a function should contain the variable names of the parameters to be passed to that
function
(a)true (b)false
Q.44 The data types mentioned in the prototype of a function are to be separated by
(a),(comma) (c):(colon)
(b).(dot) (d);(semi-colon)
Q.45 The true of the actual and formal parameters must be same
(a)True (b)false
Share with your friends: |