0% found this document useful (0 votes)
13 views

Topic5-Introduction To Loop and Using Loop For - ASSIGNMENT1

Uploaded by

Da Vy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Topic5-Introduction To Loop and Using Loop For - ASSIGNMENT1

Uploaded by

Da Vy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment (part 1)

Loop exercises: Write a C program to …

1. Display all numbers from 99 to 1.


2. Display all numbers from 1 to 100 except the number 50.
3. Display odd numbers between 8 to 1000 except the numbers 11, 17 and 21.
4. Show all integer divisible by 3 between 1 to 100 except 30, 60, and 90.
5. Sum all numbers from 1 to 100 then display the result.
6. Multiply all numbers from 1 to 100 then display the result.

11
Assignment (part 1)
Loop exercises: Write a C program to …

7. Display the words “Hi” 20 times and then “bye” 10 time using For loop. One line for
displaying the word “Hi”, and another line for displaying the word “bye”.
8. Display all even numbers between 0 to 30.
9. Calculate factorial of integer number n, where n is a positive number entered by a user.
10. Write an algorithm to sum suite number from 1 to n, where n is a positive number
entered by a user.

12

You might also like