Trace table technique on Algorithm & Finding Odd number in array using C

Trace table technique on Algorithm & Finding Odd number in array using C

Task 1
Test the following algorithm using the trace table technique. The
given variables values are: x = 3, y = 5.

  1. Declare the integer variables x, y, z

  2. Ask the user to Enter the first integer number

  3. Input x by the user.

  4. Ask the user to Enter the second integer number

  5. Input y by the user.

  6. Compute x*2+y*3 and assign the result to the variable z.

  7. Display the value of the variable z.


Task 2
Write a C program to print the odd elements of the following array on the screen ar[] = { 2, 1, 8, 5, 9, 6};
Powered by