0

C programming

Description: C
Number of Questions: 25
Created by:
Tags: C Programming Programming
Attempted 0/25 Correct 0 Score 0

'C' language is called as the modified language of _________.

  1. C++

  2. Java

  3. BPCL

  4. None of these


Correct Option: C
Explanation:

BPCL refers to Basic Combined Programming Language is the generator of new language called 'C'. Dennis Ritchie implemented this language at Bell laboratories and named it 'C'.

In 'C', header files are declared in ___________ section.

  1. documentation

  2. link

  3. main program

  4. none of these


Correct Option: B
Explanation:

This section is used to declare the header files. These files are required to link to an appropriate function defined in it.

Which of the following backslash characters is called null character constant in 'C'?

  1. '\0'

  2. 'n'

  3. 't'

  4. 'b'


Correct Option: A
Explanation:

This is the backslash null character constant used to indicate end of the character array or string.

String constants are also called _________ in 'C' language.

  1. integer constants

  2. real constants

  3. character constants

  4. none of these


Correct Option: C
Explanation:

These are also called as string constants in 'C'.

Which of the following data types requires the least amount of size in bits in 'C'?

  1. int

  2. long int

  3. unsigned short int

  4. none of these


Correct Option: C
Explanation:

This data type requires least amount of bits, i.e 8 bits to be get stored in memory.

Which library function in C is used to raise any number to the power of any other number?

  1. exp(x)

  2. pow(x,y)

  3. sqrt(x)

  4. None of these


Correct Option: B
Explanation:

This function raise x to the power of y in a C language.

What would be the result of the following statement in C?

printf(n %d,4%3)

  1. 1

  2. 4

  3. 3

  4. None of these


Correct Option: A
Explanation:

% symbol refers to modulus operator in C, which returns remainder when two integers are divided.hence, it is the correct answer.

With which of the following formatted functions is the EOF() end of file function used?

  1. gets()

  2. getchar()

  3. printf()

  4. none of these


Correct Option: B
Explanation:

The EOF() returns -1 as a result if the getchar() function does not return any character.

Which of the following data types is used in 'C' to deal with different data types in a single unit?

  1. Array

  2. Pointer

  3. Structure

  4. None of these


Correct Option: C
Explanation:

These are user-defined data types in 'C' used to hold different data types and can be accessed by structure variable along with dot operator in the main program.

In 'C' by default, the main program returns _____________ value at the end of the program.

  1. int

  2. char

  3. float

  4. none of these


Correct Option: A
Explanation:

All 'C' program returns integer type of value by default, if the return type is not specified.

Which of the following format specifiers is used in 'C' to print an integer argument in hexadecimal base?

  1. %o

  2. %g

  3. %s

  4. %x


Correct Option: D
Explanation:

This format specifier is used in 'C' to print an integer argument in hexadecimal base.

Which data type is/are more suitable to use database applications in 'C'?

  1. Arrays

  2. Pointers

  3. Structures

  4. All of the above


Correct Option: C
Explanation:

Structures are user defined data type which are more suitable to use database applications in 'C'.

In 'C', if an array is declared with 100 size, then its subscript ends at _________.

  1. 100

  2. 99

  3. 101

  4. none of these


Correct Option: B
Explanation:

As array index starts from 0 and ends with 99 for an array having size of 100. So, this is the correct choice.

_____________ are the arguments that appear when the function is called.

  1. Formal arguments

  2. Default arguments

  3. Actual arguments

  4. None of these


Correct Option: C
Explanation:

Actual arguments are the arguments that appear when the function is called.

Which of the following arrays is used for matrix application in 'C'?

  1. One-dimensional array

  2. Two-dimensional array

  3. Multi-dimensional array

  4. None of these


Correct Option: B
Explanation:

Two -dimensional array consists of two subscripts one refers to row & the second refers to column. Hence, it is used for matrix application in 'C'.

Which of the following statements indicates the base address of an array-named list to be passed as an argument in a function?

  1. list[1]

  2. list[2]

  3. list

  4. none of these


Correct Option: C
Explanation:

The name of the array when passed as an argument refers to the base address of the array in the memory.

The 'Towers of Hanoi' is an example of ____________ function in 'C' program.

  1. inline

  2. recursion

  3. nested

  4. none of these


Correct Option: B
Explanation:

Recursion is the process of calling a function by itself repeatedly.

Which of the following is/are known as channels of communication within a program?

  1. Keywords

  2. Constants

  3. Variables

  4. All of the above


Correct Option: C
Explanation:

Variables are channels of communications within a program. These are used to perform any kind of manipulation in a program.

Who among the following developed 'C' language at Bell laboratories in 1972?

  1. Bjarne Stroustrup

  2. Blaise Pascal

  3. Dennis Ritchie

  4. None of these


Correct Option: C
Explanation:

Dennis Ritchie developed 'C' language at Bell laboratories in 1972 by modifying B language.

Which of the following variables in 'C' retains its value throughout the execution of a program?

  1. Automatic variable

  2. External variable

  3. Static variable

  4. None of these


Correct Option: C
Explanation:

These are the variables that retain their values through out the execution of the program.

Which of the following library functions is used to break out of a program?

  1. break statement

  2. exit()

  3. continue statement

  4. none of these


Correct Option: B
Explanation:

This function allows a user to break out of a program.

Which of the following is not a keyword used in 'C' language?

  1. return

  2. sizeof

  3. end

  4. extern


Correct Option: C
Explanation:

It is not a keyword used in 'C' language.

Which of the following formatted input functions is used to read strings in 'C'?

  1. puts()

  2. getchar()

  3. gets()

  4. None of these


Correct Option: C
Explanation:

This function is used in 'C' to read strings.

Which of the following library functions is used to compare two strings and give appropriate results?

  1. strcat()

  2. tolower()

  3. strcmp()

  4. none of these


Correct Option: C
Explanation:

This function compares two strings and returns less than zero value if the first string is less than the second string; returns zero if both the strings are equal; and more than zero value if the first string is greater than the second string.

____________ is a statement that allows a set of instructions to be performed repeatedly.

  1. Jump statement

  2. Iteration statement

  3. Selection statement

  4. None of these


Correct Option: B
Explanation:

This statement allows a set of instructions to be performed repeatedly.

- Hide questions