Example HTML page

Assignment 6 : While Loop (Tracing)

Hi,

Do the following programs using while loop. Trace the program step by step.

  1. Write a “C” Program to print the sum of natural numbers up to a given number.  Trace the program.
  2. Write a “C” Program to print the product of natural numbers up to a given number.  Trace the program.
  3. Write a “C” Program to print the sum of squares of natural numbers up to a given number.  Trace the program.
  4. Write a “C” Program to print the product of squares of natural numbers up to a given number.  Trace the program.
  5. Write a “C” Program to print the sum of cubes of natural numbers up to a given number.  Trace the program.
  6. Write a “C” Program to print the product of cubes of natural numbers up to a given number.  Trace the program.
  7. Write a “C” Program to print the result of factorial for a given number using while loop.
Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest