0% found this document useful (0 votes)
14 views1 page

Assignment Loops

The document outlines a computer science assignment consisting of 16 tasks focused on using loops in programming. Tasks include printing elements of a list, calculating sums, generating multiplication tables, counting vowels, and finding prime numbers. The assignment aims to enhance programming skills through practical exercises involving loops.

Uploaded by

ishaansb2526
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Assignment Loops

The document outlines a computer science assignment consisting of 16 tasks focused on using loops in programming. Tasks include printing elements of a list, calculating sums, generating multiplication tables, counting vowels, and finding prime numbers. The assignment aims to enhance programming skills through practical exercises involving loops.

Uploaded by

ishaansb2526
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ASSIGNMENT

COMPUTER SCIENCE

1. Write a loop to print all the elements of a list.


2. Use a loop to calculate and print the sum of all numbers from 1 to 100.
3. Write a program using a loop to print the multiplication table of 5.
4. Create a program that uses a loop to count the number of vowels in a given string.
5. Write a loop to print the even numbers between 1 and 50.
6. Use a loop to iterate through a list of numbers and print out only the numbers greater
than 10.
7. Create a for loop that prints a pattern of stars
*
**
***
****
*****
8. Write a program to calculate the factorial of a given number using a loop.
9. Use a loop to find the maximum value in a list of numbers.
10. Write a program that takes a list of integers and creates a new list with the squares of
those integers using a loop.
11. Write a program that finds the prime numbers between 1 and 100 using a loop.
12. Use a loop to reverse a given string and print the reversed string.
13. Write a program that uses a loop to generate the Fibonacci series up to a certain
number.
14. Create a loop to iterate through two lists of equal length and print their
corresponding elements side by side.
15. Use a loop to print the numbers from 1 to 50, but skip every number divisible by 5.
16. Write a loop to print the first 10 elements of an arithmetic sequence with a common
difference of 3.

You might also like