Assignment 6 : While Loop (Tracing)
Hi,
Do the following programs using while loop. Trace the program step by step.
- Write a “C” Program to print the sum of natural numbers up to a given number. Trace the program.
- Write a “C” Program to print the product of natural numbers up to a given number. Trace the program.
- Write a “C” Program to print the sum of squares of natural numbers up to a given number. Trace the program.
- Write a “C” Program to print the product of squares of natural numbers up to a given number. Trace the program.
- Write a “C” Program to print the sum of cubes of natural numbers up to a given number. Trace the program.
- Write a “C” Program to print the product of cubes of natural numbers up to a given number. Trace the program.
- Write a “C” Program to print the result of factorial for a given number using while loop.