Friday, 1 September 2017

C Question



Download C question text file








Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?


rem = 3.14 % 2.1;
rem = modf(3.14, 2.1);
rem = fmod(3.14, 2.1);
Remainder cannot be obtain in floating point division.


3
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
What are the types of linkages?


Internal and External
External, Internal and None
External and None
Internal


2
`````````````````````````````````````````````````````````````````````````````````````````````
Which of the following special symbol allowed in a variable name?


* (asterisk)
| (pipeline)
- (hyphen)
_ (underscore)


4
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````


How would you round off a value from 1.66 to 2.0?


ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)


1
````````````````````````````````````````````````````````````````````````````````````````````````
What are the different types of real data type in C ?




float, double
short int, double, long int
float, double, long double
double, long int, float


3
```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
What will you do to treat the constant 3.14 as a long double?


use 3.14LD
use 3.14L
use 3.14DL
use 3.14LF


2
``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````


What is (void*)0?


Representation of NULL pointer
Representation of void pointer
Error
None of above


1
````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````


In which header file is the NULL macro defined?


stdio.h
stddef.h
stdio.h and stddef.h
math.h


3


``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
How many bytes are occupied by near, far and huge pointers (DOS)?




near=2 far=4 huge=4
near=4 far=8 huge=8
near=2 far=4 huge=8
near=4 far=4 huge=8


1
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````


If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?


.
&
*
->


4


````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````


How will you free the allocated memory ?


remove(var-name);
free(var-name);
delete(var-name);
dalloc(var-name);


2
``````````````````````````````````````````````````````````````````````````````````````````````````````````````````


What is the similarity between a structure, union and enumeration?


All of them let you define new values
All of them let you define new data types
All of them let you define new pointers
All of them let you define new structures


2
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
In which numbering system can the binary number 1011011111000101 be easily converted to?


Decimal system
Hexadecimal system
Octal system
No need to convert


2
````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````


Which bitwise operator is suitable for turning off a particular bit in a number?


&& operator
& operator
|| operator
! operator


2


```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
Which header file should be included to use functions like malloc() and calloc()?


memory.h
stdlib.h
string.h
dos.h


2


``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
What function should be used to free the memory allocated by calloc() ?


strnchar()
strchar()
strrchar()
strrchr()


4


```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
What is stderr ?


standard error
standard error types
standard error streams
standard error definitions


3


```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
In mathematics and computer programming, which is the correct order of mathematical operators ?


Addition, Subtraction, Multiplication, Division
Addition, Subtraction, Multiplication, Division
Multiplication, Addition, Division, Subtraction
Addition, Division, Modulus, Subtraction


2


`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
Which of the following cannot be checked in a switch-case statement?


Character
Integer
Float
Enum


3


`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
The keyword used to transfer control from a function back to the calling function is


switch
goto
go back
return


4


`````````````````````````````````````````````````````````````````````````````````````````````````


What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?


The element will be set to 0.
The compiler would report an error.
The program may crash if some important data gets overwritten
The array size would appropriately grow.


3

No comments:

Post a Comment

Code

<html> <head> <title>Implimentation</title> <script type="text/javascript"> fu...