Computers and Technology
11.01.2021 13:17
241
386
9
Solved by an expert

Can someone give me example of three types of loop in pascal (it has to has randomize

Can someone give me example of three types of loop in pascal (it has to has randomize in it too)
Show Answers
nabilop234
nabilop234
4,5(66 marks)
Sr.NoLoop Type & Description
2for-do loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
3repeat-until loop Like a while statement, except that it tests the condition at the end of the loop body. (HOPE THIS HELPS!!)
sreyasusanbinu
sreyasusanbinu
5,0(99 marks)

#include <stdio.h>

int main()

{

//Store temp in Fahrenheit

int temp_fahrenheit;

//store temp in Celsius

float temp_celsius;

printf("\nTemperature conversion from Fahrenheit to Celsius is given below: \n\n");

printf("\n%10s\t%12s\n\n", "Fahrenheit", "Celsius");

//For loop to convert

temp_fahrenheit=0;

while(temp_fahrenheit <= 212)

{

temp_celsius = 5.0 / 9.0 *(temp_fahrenheit - 32);

printf("%10d\t%12.3f\n", temp_fahrenheit, temp_celsius);

temp_fahrenheit++;

}

return 0;

}

Explanation:

The program above used a while loop for its implementation.

It is a temperature conversion program that converts integer Fahrenheit temperatures from 0 to 212 degrees to floating-point Celsius temperatures with 3 digits of precision.

This can be calculated or the calculation was Perform using the formula celsius = 5.0 / 9.0 * ( fahrenheit - 32 ).

The expected output was later printed in two right-justified columns of 10 characters each, and the Celsius temperatures was preceded by a sign for both positive and negative values.

Popular Questions about the subject: Computers and Technology

Violating copyright laws can result in both criminal and civil charges...
Computers and Technology
28.09.2022 04:06
What is the trickiest time of the day to drive? A. Early morning B. Late...
Computers and Technology
09.11.2020 07:44
What can be viewed in the tasks folder? check all that apply. e-mail messages...
Computers and Technology
26.10.2022 15:15
Two basic types of satellite images are: a. heat and true color b. full...
Computers and Technology
10.03.2022 20:38
The demand for it professionals who know how to secure networks and computers...
Computers and Technology
27.06.2022 21:43
Ihave the following assignment for computer science class that is due tomorrow....
Computers and Technology
06.02.2022 21:34
Drag each label to the correct location on the image. match each mode dial...
Computers and Technology
02.09.2022 13:12
Which of these is not one of the three features in a loop...
Computers and Technology
07.05.2021 23:53
The presentation layer describes the layer where computers interact with...
Computers and Technology
20.09.2020 19:29
Which best describes the significance of arpanet? a. it was the first wan....
Computers and Technology
30.05.2021 03:00

New questions by subject

If ur a real ganta put a pic of blood a pic of u...
History
13.08.2020 12:21
Lisa’s Morgan horse weighs 800 lb and needs to get a medication that is...
Mathematics
11.01.2021 14:30
A show started at 6:30 p.m. and ended at 8:35 p.m. about how long was the...
Mathematics
29.08.2021 23:39
3 4 5 What is the social strata that surrounds an individual called?...
Social Studies
24.07.2021 00:05
Keyonnn IS A HORRIBLE MODERATOR my slogan is keyonnn and school suxs...
Arts
13.10.2020 06:42
The table below displays data that Stacy collected. What type of association...
Mathematics
20.04.2022 05:07
Carlos designs the skateboard ramp shown in the diagram, 132in h? 22 degrees...
Mathematics
22.07.2021 19:09
Help T-T what is 1/4 x 25...
Mathematics
10.10.2020 04:00
#
#
#
#
# #

We expand our knowledge with many expert answers