Question
Subject: Program loop Description: Write a program to add up all the odd numbers between 1 to 100. Example, Hint: Two probable ways to solve
Subject: Program loop
Description: Write a program to add up all the odd numbers between 1 to 100. Example,
Hint: Two probable ways to solve the problem. You can come up with your own.
1. You can store the numbers in memory then read and add them. (See practice from lab 0)
2. Starting from 1 you can generate the numbers by adding 2 with the current number Update your sum as sum+current number. Loop till the current number is greater than 100
Requirement
1. Demonstrate that your program is working.
2. Write a lab report that includes your name and techid, flow chart (or algorithm) Keep it with you when your TA is grading.
3. Upload your code to D2L (Filename: txt) before you show your code to TA. If you have multiple files, place them in a folder, zip it and upload it to d2l.
Due date:
1. Program demo: September 12(Wednesday section) and September 17 (M section) onday
2. Lab Report: During lab demo
Note: This is an individual lab assignment
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started