C Fundamental Test 3

13) Which operator can be used for accessing the value stored at address of a pointer variable?
A.#
B.*
C.&&
D.@

Correct Answer:B.(The pointer operator is,& (address operator) = It gives address of the variable.*(Value operator) = It gives value stored at particular address.)

14) The types of linkages in C programming language are:
A.External linkage and None linkage
B.Internal linkage and None linkage
C.Internal linkage, External linkage and None linkage
D.Internal linkage and External linkage

Correct Answer:C.(Internal linkage: A functions and static variables with file scope.
External linkage: A global, functions and non-static variables.
None linkage: A local variables.)

15) Which of the following is true about C Programming?
Platform Independent
High level language
Machine Independent
Assembly language

Correct Answer:C.(C-programming language is machine independent programming language. It provides the feature of portability of code means source code written on one machine can be run on any other machines.)

16) What is the correct value returned to the operating system upon successful completion of a program?
A.0
B.-1
C.1
D.Programs do not return a value

Correct Answer:A.(After successful completion of a program, 0 is returned to the operating system.)

17) Who is known as the founder of C language?
A.James Gosling
B.Martin Richard
C.Brian Kernighan
D.Dennis Ritchie

Correct Answer:D.(The C programming language has been developed by Dennis Ritchie in the year 1972 while working at AT&T Bell Laboratories.)

18) The C variables are case insensitive.
A.True
B.False

Correct Answer:B.(The C variables are case sensitive. This means that variables sal, Sal and SAL would be treated as different variables in C.)

19) A character variable can store ___ character(s) at a time.
A.1
B.2
C.0
D.NULL

Correct Answer:A.(A character variable can at a time store only one character. In fact, if we execute the following statements, what gets stored in variable ch is not really the character constant, but the ASCII value of ‘A’, which is 65.

char ch;
ch= ‘A’;.)

20) How would you round off a value from 1.66 to 2.0?
A.floor(1.66)
B.ceil(1.66)
C.roundup(1.66)
D.roundto(1.66)

Correct Answer:B.(The ceil(1.66) is used for round off a value from 1.66 to 2.0. The ceil() returns upper value of a fractional part and floor() returns lower value.

/* Example for floor() and ceil() functions:*/
#include<stdio.h>
#include<math.h>
int main()
{
printf(“\n Result : %f” , ceil(1.44) );
printf(“\n Result : %f” , ceil(1.66) );
printf(“\n Result : %f” , floor(1.44) );
printf(“\n Result : %f” , floor(1.66) );
return 0;
}
// Output:
//Result : 2.000
//Result : 2.000
//Result : 1.000
//Result : 1.000)


Warning: Undefined variable $in_same_cat in /www/wwwroot/mtexam.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Warning: Undefined variable $excluded_categories in /www/wwwroot/mtexam.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27
< PREVIOUS POSTC Fundamental Test 2

Leave A Comment?