In C, correct order(s) of a function implementation:
Choose at least one answer.
a. Return type, body, function name, parameters
b. Return type, body, parameters, function name
c. Return type, function name, parameters, body
d. Return type, parameters, body, function name ** Answ** C
Once the function ends, the control is returned back to the ... function and execution
continues from the statement immediately after the function call
a. executing
b.called
c.declared
d.calling ** Answ** A
When does the code block following while(x<100) execute?
a.when x is less than one hundred
b.when x is equal to one hundred
c.when x is greater than one hundred
d.while it wishes ** Answ** A
What number is equivalent to -4e3?
a.-4000
b.-400
c..004
d..0004
e.-40 ** Answ** A
Declare a two dimensional integer array of two rows and four columns having some
initial values
a.int arr1[4][2]={{8,12},{22,45},{23,40},{44,79}}
b.int arr1[2][4]={{8,12},{22,45},{23,40},{44,79}}
c.int arr1[4][2]={{8,12};{22,45};{23,40};{44,79}}
d.int arr1[][2]={{8,12},{22,45},{23,40},{44,79}} ** Answ** A
A string is a ... array of characters terminated by a null('\0')
a.one-dimensional
b.two-dimensional ** Answ** A
Consider the following code:
if(a==b)
printf("\n the number are equal");
else(a<b)
,printf("\n the smaller number is: %d",a);
else
printf("\n the smaller number is: %d",b);
in the above code, if a=14 and b=9, then the .... clause is executed
a. else
b.if
c else if ** Answ** A
The while loop can be written as a for loop
a.TRUE
b.FALSE ** Answ** A
A comment can be split over more than one line, as follows
/** A program
to calculate average
of 5 numbers. **/
a.TRUE
b.FALSE ** Answ** A
Using break statement we can exit from
a. for a loop
b. an if statement
c. the main() function
d. a program ** Answ** A
What is the output when the sample code below is executed?
char mess[]="Your are welcome here";
char *p;
p=mess;
mess[8]='\0';
puts(++p);
a.our are wel
b.our are
c.Your are
d.Your are wel ** Answ** A
Which of the following statement are true with regards to the || operator?(select al
correct answer)
A. this operator is used to combine two conditional expressions which evaluate to true
as a whole only if either of the two expressions evaluate to true.
B. only if both the expressions evaluate to false, the outcome is false
C. if one of the conditional expressions return false, the outcome is false
D. this operator is used to combine two logical expressions which evaluate to true if
both individual expression are true
e. a & b ** Answ** E
,What is the incorrect statement about floating-point data types(float and double)?
a. computers store floating-point data using separate components, including the
mantissa and exponent
b.float-point means that the decimal point can float(that is, it can ba placed anywhere
relative to the significant digits)
c.both data types(float and double) can represent arbitrarily small as well as arbitrarily
large numbers
d.none of the above ** Answ** B
In myfile.c does not exist, what will be output of this program?
#include<stdio.h>
main(){
FILE *fi;
fi=fopen("myfile.c","r");
if(fi=NULL)
{puts("file is not opened");
exit(1);}
else
puts("FILE opened");}
a. file is not opened
b.no output
c.FILE opened
d.error ** Answ** B
What does the following declaration mean (if there are more than one correct answers,
choose the best one)
int *ptr[10];
a.array of 10 integer pointers
b.pointed to the array of 10 elements
c.array of 10 pointers ** Answ** B
Which one of the following is a variable, which can contain the address of the memory
location of another variable?(choose the best answer)
a.string
b.struct
c.array
d.pointer ** Answ** B
How is a variable accessed from another file?
a. the global variable is referenced via the auto specifier
b. the global variable is referenced via the extern specifier
c. the global variable is referenced via the pointer specifier
d. the global variable is referenced via the ext specifier
e. the global variable is referenced via the global specifier ** Answ** B
Which option is correct about the function scanf?
, a.EOF indicates that scanf filled all addresses successfully
b. scanf returns the number of addresses successfully filled of EOF
c.return avoid type ** Answ** B
What value will x contain in the sample code below?
int x=011|0x10;
a.27
b.19
c.25
d.13
e.3 ** Answ** C
Which of the following can be used to append one string at the end of another
a.strcpy
b.strcmp
c.strcat
d.none of the above ** Answ** C
According to the standard C specification, what are the respective minimum sizes (in
bytes) of the following two data type: int and long?
a.2,8
b.4,8
c.2,4
d.2,2 ** Answ** C
Which ARE the following statements printf % character?
a.printf("\%")
b.printf("\\%")
c.printf("\%%") ** Answ** C
Which one of the following is a valid function definition?
a. double funct(int a,b, double c,d)
b. double funct(int a,b, double c)
c. double funct(char a,b, double d)
d. double funct(int a,int b, double c) ** Answ** D
The operation between float and int would give the result as
a. float
b. int
c. unsigned int
d.none of the above ** Answ** D
The precedence of operators is ___
A. Arithmetic, Comparison, Logical
B. Logical, Comparison, Arithmetic
C. Comparison, Arithmetic, Logical