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. jump the control to specific location o screen

  2. hold the control for user input

  3. end the program execution

  4. restart the execution from beginning

  5. jump the control up or down at its label

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

The goto statement is used to jump the control in a program to its label in the function irrespective of its place in the sequence of coding.

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. a

  2. If-Then-Else

  3. While loop

  4. GoTo

  5. Decode

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

If-Then-Else is a conditional control structure in PL/SQL that allows unconditional approach to different parts of code based on condition evaluation. The IF statement evaluates a condition and executes different code blocks accordingly, providing structured decision-making capability.

Multiple choice
  1. Declaration

  2. Execution

  3. Exception

  4. Header

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

In PL/SQL block structure, user-defined exceptions are trapped and handled in the EXCEPTION section. The DECLARE section is for declarations, the EXECUTE section (between BEGIN and END) contains executable logic, and there is no 'Header' section in standard PL/SQL.