IEOR Programming Test - I

Is this your test? Login to manage it. If not, you can develop an exam just like it.

This is a non-interactive preview of the quiz content.

1.
1 point
What is the correct output for the following program?

#include
int main()
{
int arr[1]={10};
printf("%d\n", 0[arr]);
return 0;
}
2.
1 point
What will be the output of the program?

#include
int main()
{
float arr[] = {12.4, 2.3, 4.5, 6.7};
printf("%d\n", sizeof(arr)/sizeof(arr[0]));
return 0;
}
3.
1 point
Identify which of the following are declarations.
I. long x;
II. float square (float x){...}
III. double pow(double, double);
4.
1 point
The expression of the right hand side of || operators doesn't get evaluated if the left hand side determines the outcome.
5.
1 point
Which of the following is correct about class and structure?
6.
1 point
Choose the correct choices to complete the following sentences.
__________ defines a set of possible values and a set of operations for an entity.
__________ is some memory that holds a value of some type.
7.
1 point
Consider the following recursive function fun(x, y). What is the value of fun(4, 3). Note that recursive function is a form of a function which calls itself.

int fun(int x, int y)
{
if (x == 0)
return y;
return fun(x - 1, x + y);
}
8.
1 point
Binary tree is a data structure in which each node can have at most 2 child nodes. Height of a binary tree is a path length from the bottom-most node to the root node. What is the maximum no. of total nodes and maximum no. of leaf nodes a binary tree with height ‘h’ can have? Note that leaf nodes are the nodes with no child nodes.
9.
1 point
Which of the following is not logical operator?
10.
1 point
What is the correct output of the following program?

#include
void fun(int*, int*);
int main()
{
int i=5, j=2;
fun(&i, &j);
printf("%d, %d", i, j);
return 0;
}
void fun(int *i, int *j)
{
*i = *i**i;
*j = *j**j;
}
11.
1 point
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?
12.
1 point
Stack is a data structure in which the elements can be accessed in LIFO manner. Consider an empty stack of integers. Let the numbers 1,2,3,4,5,6 be pushed on to this stack only in the order they appear from left to right. Then which of the following permutations are possible using Push and Pop operations on the stack.
13.
1 point
Which of the following statement is correct?
14.
1 point
In C, if you pass an array as an argument to a function, what actually gets passed?
15.
1 point
If the MAX_SIZE is the size of the array used in the implementation of circular queue, array index start with 0. 'front' point to the first element in the queue, and 'rear' point to the last element in the queue. Which of the following condition specify that circular queue is FULL?
16.
1 point
Which of the following is/are not user defined data type(s)?

I. struct book{
char name[10];
float price;
int pages;
};

II. long int l=2.35;

III. enum day {sun,mon,tue,wed};
17.
1 point
Which of the following function is correct that finds the length of a string?
18.
1 point
Which of the following is not a type of inheritance?
19.
1 point
Consider the ASCII character encoding scheme which uses 1 Byte for storing characters in form of the ASCII values. What are the maximum possible numbers of ASCII values that can be stored using this 1 Byte encoding scheme.
20.
1 point
What is the correct output for the following program?

#include
int main() {
char str[] = "peace";
char *s = str;
printf("%s\n", s++ +3);
return 0;
}