0

Programming Concepts

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

C programming was invented by ___________.

  1. Dennis Ritchie in 1972

  2. Dennis Lily in 1971

  3. George in 1972

  4. Runge Kutta in 1970

  5. Both Dennis Ritchie and Dennis Lily in 1972


Correct Option: A
Explanation:

He was the famous scientist who developed C programming.

Which of the following is a valid identifier?

  1. data 1

  2. fil_2

  3. a-b

  4. return

  5. for


Correct Option: B
Explanation:

This is a valid identifier.

If a=5 and b=8, what is the value of a & b?

  1. 0000

  2. 1101

  3. 0101

  4. 1000

  5. 1111


Correct Option: A
Explanation:

Change a and b in binary a=0101, b=1000 a & b=0000

What is the value of floor (-5.2)?

  1. -5

  2. -6

  3. -5.2

  4. -4

  5. -7


Correct Option: B
Explanation:

This is the correct answer because floor function give the lowest value floor(-5.2 ) =-6. This is the correct answer.

If a=10 and b=20, what is the value of c=a>b?

  1. 10

  2. 20

  3. 15

  4. 0

  5. 1


Correct Option: B
Explanation:

This is conditional operator when condition is true, then the value of c=a and in case of false c=b=20.

What is the value of Ceil (-3.8) in C programming language?

  1. -3

  2. -4

  3. -5

  4. -2

  5. -3.8


Correct Option: A
Explanation:

Ceil function provides the largest value of the given value. So, Ceil(-3.8)=-3 and -3 is greater than -3.8.

If x=5 and y=++x, what are the values of x and y?

  1. x=5, y=5

  2. x=5, y=6

  3. x=6, y=6

  4. x=6, y=5

  5. x=5, y=7


Correct Option: C
Explanation:

This is the correct answer. Here student uses Pre increment operator of C programming language and increases the value of x by 1. After that he assigns the value of x to y and he also assigns new value to x, which is 6. So, both x and y contain 6.

If a=4, then b=a. What are the values of a and b?

  1. 4, 4

  2. 4,3

  3. 3,3

  4. 3,4

  5. 2,4


Correct Option: D
Explanation:

Here value of a is assigned to b before decrement.

Which of the following explains (;;)?

  1. Finite loop

  2. Infinite loop

  3. Boolean 1

  4. Boolean 0

  5. None of the above


Correct Option: B
Explanation:

Infinite loop means it never ends and hangs the program.

A double uses the size of ____________.

  1. 32 bit

  2. 64 bit

  3. 16 bit

  4. 80 bit

  5. 8 bit


Correct Option: B
Explanation:

This bit size is used by Double.

If a=5 and b=7, then a | b is __________.

  1. 111

  2. 101

  3. 000

  4. 010

  5. 001


Correct Option: A
Explanation:

Firstly change in binary; a=101and b=111 a|b=111

What is the value of a/b if both are floats; a=22.0 and b=3.0?

  1. 7

  2. 22/3

  3. 7.33

  4. 6

  5. 8


Correct Option: C
Explanation:

If you solve and both are floats, then the result is 7.33.

While loop is called ______________.

  1. entry controlled loop

  2. exit controlled loop

  3. exit-entry controlled loop

  4. entry-exit controlled loop

  5. output controlled loop


Correct Option: A
Explanation:

As it controls entry and if entry condition is true, then you can go into the loop otherwise you cannot enter into the loop.

What is the value of 14%3+7%2 in C progamming language (where two operators are used; first is modulus operator and the second is addition operator)?

  1. 3

  2. 7.6

  3. 7.5

  4. 8.1

  5. 8


Correct Option: A
Explanation:

This is the correct answer because % operator has high priority than + operator. So when it executes, the answer will be 3.

do while is called _________.

  1. entry controlled loop

  2. exit controlled loop

  3. input controlled loop

  4. output controlled loop

  5. entry-exit controlled loop


Correct Option: B
Explanation:

It is called exit controlled loop because the body of loop is executed at least once if condition is false.

- Hide questions