Programming, Data Structure & Algorithm - 1

Programming, Data Structure & Algorithm - 1

16 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The statement which makes a while loop to skip statements in the current iteration and goes straight to while condition checking.

  1. Break
  2. Continue
  3. Skip
  4. None
Question 2 Multiple Choice (Single Answer)

Find out odd one out of the following statements assuming an integer variable, a, whose value is already initialised to 10.

  1. printf(“%d ”, a)
  2. printf(“%d ”, *&a)
  3. printf(“%d ”, &&&&&&a)
  4. printf(“%d ”, &&&&&*&a)
Question 3 Multiple Choice (Single Answer)

Find the odd one out of the following.

  1. int i = 0; while(i < 5){ i++;}
  2. int i = 1; while(i < = 5){ i++;}
  3. int i = 5; while(i--);
  4. int i = 5; while(--i);
Question 4 Multiple Choice (Single Answer)

Assume that we want to exchange values of two unsigned character type variable values. Only one operator is permitted to be used. What will be it?

  1. +
  2. <<
  3. ^
Question 5 Multiple Choice (Single Answer)

First argument in sprint is

  1. an integer
  2. a string variable
  3. a float
  4. none of the above
Question 6 Multiple Choice (Single Answer)

C language uses _____ characters.

  1. ASCII
  2. ISCII
  3. UNICODE
  4. EBCDIC
Question 7 Multiple Choice (Single Answer)

What is the output of the following code fragment?
int i = 0, j = 3;
while(i++<5|| j--) printf(“Hi”);

  1. HiHiHiHiHiHiHiHi
  2. Hi
  3. HiHiHi
  4. HiHiHiHiHi
Question 8 Multiple Choice (Single Answer)

Dangling memory is the 

  1. memory which is allocated using dangling function instead of malloc
  2. memory which is allocated and freed in the same block
  3. memory which is allocated in a function and control returns from the function with its starting address such that this memory is accessed outside
  4. memory which is allocated in our account but we don’t have freedom to use the same
Question 9 Multiple Choice (Single Answer)

If a is a valid 2-D character array, then 0[a] refers to

  1. invalid
  2. first row of the 2-D character array
  3. first row first element of the 2-D character array
  4. none of the above
Question 10 Multiple Choice (Single Answer)

What is the output of the following code fragment?
int i = 10;
if(i = printf(“%d”, i))
{
printf(“%d ”, i);
}

  1. 10
  2. 0
  3. 102
  4. 2
Question 11 Multiple Choice (Single Answer)

Dangling memory is the

  1. memory which is allocated using dangling function instead of malloc
  2. memory which is allocated and freed in the same block
  3. memory which is allocated in a function and control returns from the function with its starting address such that this memory is accessed outside
  4. memory which is allocated in our account but we don’t have freedom to use the same
Question 12 Multiple Choice (Single Answer)

A variable becomes pointer type if

  1. we use * before it in its declaration
  2. we use ** before it in its declaration
  3. we use *** before it in its declaration
  4. all of the above
Question 13 Multiple Choice (Single Answer)

Find the odd one with respect to:

  1. printf
  2. main
  3. scanf
  4. #define
Question 14 Multiple Choice (Single Answer)

What is the result of the following program?
int a[2][2][2] = { 10, 2, 3, 4, 5, 6, 7, 8 };
printf("%d",***a);

  1. Error
  2. 10
  3. Address of the array
  4. None
Question 15 Multiple Choice (Single Answer)

The scanf function returns

  1. integer
  2. number of values which it reads
  3. both the above
  4. none of the above