Computer Knowledge

Programming Fundamentals

2,381 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. It is a group of variables of similar datatype.

  2. It stores the data in consucative memory location.

  3. It is referred by a common name.

  4. int val[5].

  5. Array size can be changed during program execution.

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

Increasing or decreasing of array size is not possible during program execution. Array size must be decided during program coding.

Multiple choice
  1. define P printf

  2. define P printf

  3. use P printf

  4. <define p="printf="></define>

  5. include

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

This is used to define a different name of functions and this is the correct coding.

Multiple choice
  1. It is a function which calls to itself.

  2. It is a process in which a function calls to itself.

  3. It runs for definite number of time without condition.

  4. It is used to call global function.

  5. It is used to call local function.

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

This is the correct option as recursion is a process in which a function calls to itself. It is commonly used to calculate factorials.

Multiple choice
  1. Compares two strings regardless of case

  2. Compares the portion of one string with portion of another string

  3. Compares the portion of one string with portion of another string regardless of case

  4. All of the above

  5. None of the above

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

strcmpi():Compares two strings without regard to case.

Multiple choice
  1. b and d

  2. a, b and d

  3. only c

  4. all of these

  5. none of these

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

‘;’ is given after while in do-while loop whereas ‘;’ is not given after while in while loop

Multiple choice
  1. Working of while and do-while loop is same.

  2. while(1) is infinite loop and exit() can be written to come outside the loop.

  3. for(;;) implements an infinite loop.

  4. A break statement takes the execution control out of the loop.

  5. A continue statement skips the execution of the statements after the control to the beginning of the loop.

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

Working of while and do-while loop is not same. As while is entry control and do-while is exit control.

Multiple choice
  1. struct test { int k; char ch; }; struct test t1,t2;

  2. struct test { int k; char ch; }t1,t2;

  3. struct { int k; char ch; }t1,t2;

  4. struct test { int k; char ch; }; test t1,t2;

  5. struct test { int k; char ch; }; struct test t[4];

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

struct test { int k; char ch; }; test t1,t2; the above declaration is wrong and it will show an error. As keyword struct is not written before test while creating variables of type test.

Multiple choice
  1. Macro

  2. Iteration

  3. Sub function

  4. Recursion

  5. Nested Function

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

The most common application of recursion is in mathematics and computer science, in which it refers to a method of defining functions in which the function being defined is applied within its own definition. Specifically this defines an infinite number of instances (function values), using a finite expression that for some instances may refer to other instances, but in such a way that no loop or infinite chain of references can occur.

Multiple choice
  1. Both windows must be defined as dialog and modal.

  2. Both windows must be defined as document and modeless.

  3. Both windows must be defined as document and modal.

  4. The default window must be defined as modeless and the Buttonswindow must be modal.

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

For free navigation between windows without restriction, both must be document and modeless. Document windows can contain multiple data blocks and modeless windows don't block interaction with other windows. Dialog windows are modal by definition, preventing free navigation. Modal windows require user response before allowing navigation elsewhere.