1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
8_murik_8 [283]
2 years ago
14

Make a Flow Chart From this C Programming Language Code

Computers and Technology
1 answer:
joja [24]2 years ago
6 0

Answer:

1) Print message "Hello Everybody"

If you wish to print a simple message "Hello everybody" in a flowchart in c language, here is the example:

flowchart in c

2) Input 2 numbers from the user and print their sum

Imagine that you are a user who wishes to put in two numbers and want their sum to be printed. Here is a flowchart for structure in c which is required:

flowchart in c language

3) Input numbers from the user and check whether it is even or odd

If you wish to put in numbers and then check whether it is an even number or an odd one, the following flowchart of c language can significantly help.

flowchart for structure in c

4) Flowchart to find the sum of the first 50 natural numbers

Let’s first see how that will look in a flow chart, and then we see the same thing mapped to a C program. This shows you why it’s important to map out your algorithm to a flow chart before you start coding it.

flow charts in c,

The loop easily translates to a simple C for loop. In this program, we initialize the variable sum =0 and n=0. In the next step, we increment n by 1 and assign sum=sum+n. We check if n=50 and if not, increment n by 1. Else we just print the sum.  

5) C Program to find the Factorial Value of a Number

Now let’s look at a bit more complex example. First, we’ll draw out the flow chart for the factorial n.

flowchart of if statement in c,

6) Control Algorithm for cooking toast in the toaster

Using a flowchart describe the control algorithm that a toaster might use to cook toast. There will be a start button the user pushes to activate the machine. There is another input that measures toast temperature. The desired temperature is preprogrammed into the machine. The output is a heater, which can be on or off. The toast is automatically lowered into the oven when the heat is applied and is ejected when the heat is turned off.

flowchart in c

7) Calculation of the average of two numbers

If we have to calculate the average of any two given numbers, the following flowchart for structure in c will be made.

flowchart in c language

Explanation:

mark me brainlist pls

You might be interested in
Everyone should try to be an NFL quarterback because they earn so much money. True or False
In-s [12.5K]
No. It is statistically unlikely to even make it into the NFL. Pursuing this is not the best idea.
6 0
4 years ago
Read 2 more answers
My friend Leo wants to have an emergency plan for his final exams on University of Southern Algorithmville. He has N subjects to
leonid [27]

Answer:

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following property: At every step, we can make a choice that looks best at the moment, and we get the optimal solution of the complete problem.

If a Greedy Algorithm can solve a problem, then it generally becomes the best method to solve that problem as the Greedy algorithms are in general more efficient than other techniques like Dynamic Programming. But Greedy algorithms cannot always be applied. For example, the Fractional Knapsack problem (See this) can be solved using Greedy, but 0-1 Knapsack cannot be solved using Greedy.

The following are some standard algorithms that are Greedy algorithms.

1) Kruskal’s Minimum Spanning Tree (MST): In Kruskal’s algorithm, we create an MST by picking edges one by one. The Greedy Choice is to pick the smallest weight edge that doesn’t cause a cycle in the MST constructed so far.

2) Prim’s Minimum Spanning Tree: In Prim’s algorithm also, we create an MST by picking edges one by one. We maintain two sets: a set of the vertices already included in MST and the set of the vertices not yet included. The Greedy Choice is to pick the smallest weight edge that connects the two sets.

3) Dijkstra’s Shortest Path: Dijkstra’s algorithm is very similar to Prim’s algorithm. The shortest-path tree is built up, edge by edge. We maintain two sets: a set of the vertices already included in the tree and the set of the vertices not yet included. The Greedy Choice is to pick the edge that connects the two sets and is on the smallest weight path from source to the set that contains not yet included vertices.

4) Huffman Coding: Huffman Coding is a loss-less compression technique. It assigns variable-length bit codes to different characters. The Greedy Choice is to assign the least bit length code to the most frequent character. The greedy algorithms are sometimes also used to get an approximation for Hard optimization problems. For example, the Traveling Salesman Problem is an NP-Hard problem. A Greedy choice for this problem is to pick the nearest unvisited city from the current city at every step. These solutions don’t always produce the best optimal solution but can be used to get an approximately optimal solution.

6 0
3 years ago
A notebook computer is set up to take maximum advantage of power saving features including shutting down the display and the har
astra-53 [7]

Answer:

The reason is that the windowing system consumes significantly more memory and virtual memory than the text mode.

Explanation:

The reason behind the occurrence of this is that the windowing system consumes significantly more memory and virtual memory than the text mode. As a result, this reduces the likelihood of the hard disk becoming inactive for long enough for it to be powered down by itself with no direct human control, i.e. automatically.

6 0
3 years ago
Question # 18
borishaifa [10]

Answer:what qustoin

Explanation:sorry wala yung tanong

6 0
3 years ago
When choosing a communication channel, _____refers to the degree to which communications can be planned and recorded, thus allow
steposvetlana [31]

Answer: Control

Explanation: Communication channel is the medium created for the process of the communication.These channel let the source to destination communication in a cycle so that message can be send and received respectively.

Control in the branch of communication channel is used for the handling of the communication limit of the message that is being sent and received .It puts a limitation to the extent message can be read, recorded ,movement of resource and other facilities.

4 0
4 years ago
Other questions:
  • RADIAC instruments that operate on the ionization principle are broken down into three main categories based on what?
    15·1 answer
  • What is output when the CarTest application is run? Why?
    11·1 answer
  • Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    10·1 answer
  • Which is the correct attribute syntax
    9·1 answer
  • Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns
    14·1 answer
  • A user who has special security and access to a system, such as the right to assign passwords, is called a ____.​ a. ​ technical
    8·1 answer
  • Which is the name of a note-taking method that can be used when watching a video? SQRW sticky notes charting highlighting
    13·2 answers
  • Pls paanswer asap......​
    10·1 answer
  • 9.2.8 last names codehs
    10·1 answer
  • Say true or false. a)ICT in education is used as teaching learning aid
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!