C Programming

BASIC CONCEPTS IN PROGRAMMING THEORY QUESTIONS

1

Explain each line of the following C program:

  1. int a;
  2. int b;
  3. int c;
  4. int d;
  5. int e;
  6. a = 5;
  7. b = 10;
  8. c = a + b;
  9. d = a * c;
  10. e = b/a;
2

Indicate which control structure will be used in the following scenarios:

(a)

Check if a number is positive.

(b)

Counts from 1 to 10.

(c)

Repeats a block of code at least once.

3

Define each of the following terms:

(a)

function;

(b)

array.