Convert the given for loop to while loop and find the output of the program assuming the
value entered for num is 15.
num = int (input ("Enter a value"))
sum =0
count=0
for i in range (1, num):
if i%2 == 0:
count += 1
sum += i
print(sum)
print(count)

Answers

Answer 1

Answer:

Explanation:

num = int (input ("Enter a value"))

sum =0

count=0

i = 1

while i < num:

 if i%2 == 0:

        count += 1

        sum += i

        i += 1

 i += 1

print(sum)

print(count)

The output assuming num is 15 would be

56

7


Related Questions

15.A telecommunication company wants to start a business in Dera Ghazi khan. For Information technology (IT) support, they hired an IT Staff and want to buy hardware from the market. Choose the hardware name which is important for the company.

Answers

Answer:

The company should have computer with secured bandwidth and LAN system which can connect employees on one network.

Explanation:

Telecommunication company will require a network setup which can connect employees on a single network. The network security should be efficient which keeps the LAN network secure from cyber attacks. The IT staff should buy Telecoms equipment and hardware and keep them in a secured control room whose access is limited to certain users only.

What is the advantage of using the Selection pane to modify SmartArt?
O It can insert or edit individual graphic boxes on a slide.
O It helps to reorder or remove on-screen elements that overlap.
O It adds a new overlay for creating overlapping graphics and text.
Olt automatically aligns graphic elements to on-screen guidelines.

Answers

Answer:

B

Explanation:

Bc I said so

Answer:

It helps to reorder or remove on-screen elements that overlap

Explanation:

edge 2022

2. The
is the main and usually largest data storage hardware device in a computer​

Answers

The answer you are looking for is either Hard Drive or SSD (Solid State Disk).

While many instruments have been "electrified", there is no such thing for the drums.
Group of answer choices

True

False

Answers

False, because they are called percussion group
False. Because it is fake not true

Write a function named buildArray that builds an array by appending a given number of random two-digit integers (10-99). It should accept two parameters — the first parameter is the array, and the second is an integer for how many random values to add, which should be input by the user.

Answers

Answer:

The function in C++ is as follows:

void buildArray(int arr[], int n){

   srand(time(NULL));

   for(int i = 0;i<n;i++){

       arr[i] = rand() % 99 + 10;    }

   for(int i = 0;i<n;i++){

       cout<<arr[i]<<" ";

   }

}

Explanation:

This defines the function

void buildArray(int arr[], int n){

This klets the program generate different random numbers

   srand(time(NULL));

This iterates from 0 to n - 1 (n represents the length of the array)

   for(int i = 0;i<n;i++){

This generates random 2 digit integer into the array

       arr[i] = rand() % 99 + 10;    }

This iterates through the array and print the array elements

   for(int i = 0;i<n;i++){

       cout<<arr[i]<<" ";

   }

}

See attachment for complete program that includes the main

Other Questions
Help please thanksXxxxxxx Someone help me ASAP HELP!! i will give brainliest!! A forest ranger spots a fire from 23-foot tower. The angle of depression from the tower to the fire is 15 degrees What is the rate of change of the function represented by the table?xy152535450145 What is the surface area of the cylinder with height 7 mi and radius 4 mi? Round to the nearest thousandth Why does Sam want to be cremated in The Cremation of Sam McGee? hi please help me with this angles work for math class giving brainliest *easy* A and b are positive integers and a-b=2 ... Evaluate the following:27^1/3 b / 9^1/2 aThere is an image attached of the problemPLEASE TYPE ANSWER AND SHOW WORK please answer this ASAPx-6/9=-5 10cmWhat is the height of the triangle is the area is 40 ? One clue we can observe that means a chemical reaction has occurred is the formation of light. What is one chemical reaction you can think of that causes light? can someone decode this into words or letters 71 194 38 1701 Help Find AB please explain find the cost of fencing a rectangular Park of length 150 and breadth 100 at the rate of 20 per metreplease answer fast Find the area of the parallelogram. Round to the nearest hundredth if necessary. help pls pls pls pls Calculate the molar concentration of OH ions in a 0.066 M solution of ethylamine (C2H5NH2: Kb= 6.4 x 10-)Express your answer to two significant figures. Which of the following tables of values could not represent a function?A)[tex]\left[\begin{array}{ccc}1&13\\4&22\\7&31\\10&40\end{array}\right][/tex]B)[tex]\left[\begin{array}{ccc}6&1\\12&1\\19&1\\23&1\end{array}\right][/tex]