1. Write down an algorithm to count and print the odd numbers from 1 to 100.(8 marks) 2. Write an algorithm by using a p

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Write down an algorithm to count and print the odd numbers from 1 to 100.(8 marks) 2. Write an algorithm by using a p

Post by answerhappygod »

1 Write Down An Algorithm To Count And Print The Odd Numbers From 1 To 100 8 Marks 2 Write An Algorithm By Using A P 1
1 Write Down An Algorithm To Count And Print The Odd Numbers From 1 To 100 8 Marks 2 Write An Algorithm By Using A P 1 (25.27 KiB) Viewed 11 times
1. Write down an algorithm to count and print the odd numbers from 1 to 100.(8 marks) 2. Write an algorithm by using a proper control instruction to calculate y(x) from the equation (10 marks)
-2x U EGYPT 1 2 x ≥ 0 y(x) = 1 2x x < 0 2 3. Write an algorithm that works according to the following specifications: (8 marks) a) Declare and create a list L[]of n elements and prompt the user to enter the size for the list. b) Calculate and print the average of the values entered in the List L[] by using loop. 4. What is the output from this code segment? (3 marks) Input x = 1; Input y = 0; if (x > 0 || y < 0) { } Else { } Print ('x=',x,'y=',y) 5. For the following algorithm: (5 marks) input m if m<0 then {m = -m} while( (m<=5)) { m = m + 1 } a) What is the value of (m) to skip the loop? b) What is the value of (m) to enter the loop only once?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply