Computer Knowledge

Programming Fundamentals

2,611 Questions

Programming fundamentals form the core logic of software development and computer science. This includes variable declarations, pointer assignments, loop iterations, and exception handling. These technical topics are regularly tested in computer knowledge and IT officer competitive examinations.

Variables and arraysPointer assignmentsLoop iterationsException handling blocksCompile time errorsFunction references

Programming Fundamentals Questions

Multiple choice
  1. Auto keyword is necessary to declare the automatic variables.

  2. By default, the variables declared are called automatic variables.

  3. Static variables can be accessed till the end of the program.

  4. External variables can be accessed till the end of the program.

  5. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

It is not a mandatory condition to declare the automatic variables by using auto keyword.

Multiple choice
  1. Top[i]=Top[i+1]

  2. Top[i]=Bottom[i+1]

  3. Top[i]=Bottom[i]

  4. Top[i]=Bottom[i-1]

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Here 'i' is the stack number, if stack i is full then bottom of new stack begins from there, applicable for multilevel queue. For multilevel queue (n/m)*i - 1, where n is the size of array, m is the size of stack and i is the stack number, let n =9, m=3, then three stacks can be implemented on it. So i = 0, 1, 2. Put i in formula (n/m)*i - 1 for 0 we get -1, -1 is bottom of first stack. Put i=1, we get 2, and 2 is the top for first stack and bottom for second stack. Option says top of first queue is equal to bottom of second queue. So, it is the correct option. As first stack is full, this satisfies the overflow condition.