Questions tagged as 'do-while'

3
answers

What is the usefulness and importance of "do ... while"?

The while command is a repeating structure with a condition at the beginning of the declaration. Example:    while (condition) {         sentences to run   } Already do... while has verification at the end, ie, the repea...
asked by 06.08.2015 / 15:22
3
answers

While repeat structure to recalculate in C

I solved this exercise below and thought about putting a while repetition structure, so the person recalculates. But when I put 's' to return and recalculate, the exercise sums up the values of the 10 numbers I previously calculated and a...
asked by 11.09.2015 / 23:44
3
answers

from while to number other than 0 in C

I need the program to stop when the consumer number is 0. So I put one of the while saying that while the consumer number is different from 0 it continues the program and when the consumer number is 0, it finish the program. It turns out...
asked by 19.09.2015 / 17:40
1
answer

Output condition in do-while in C code

I need the user to enter the numbers 1, 2 or 3 to choose the locations, and if not select one, ask again. However, when you enter the number 0 or 4, for example, it returns to the home screen (which would be the menu of destinations, costs an...
asked by 24.06.2018 / 23:36
1
answer

What's the difference between the "while" structure and repeat in VisualG?

What's the difference between the "while" structure and repeat in VisualG? Do you have an example?     
asked by 20.11.2016 / 16:44
2
answers

Method of finding roots of a function in Fortran

I have created a code that uses 3 methods to determine the roots of a function, the direct method of kicking values of x, Newton-Raphson and secants. In the direct method, I set values of x close to the roots, and I used the while to add increme...
asked by 29.04.2017 / 23:13
1
answer

Loops based on a flowchart

How do I write code for a loop based on this flowchart? It has do...while . I need a straightforward answer with nested loops.     
asked by 02.11.2017 / 03:54
2
answers

Store all records in a table in a variable (PHP)

I need to query my MySQL database and store all rows that are returned within the $dadosBrutos variable. The purpose is for each line to be separated by the character "§", for example: nomeCliente1,telefoneCliente1§nomeCliente2,telefon...
asked by 27.12.2018 / 02:32
2
answers

How to use getche () with do-while in C?

I have the following variable: #include <stdio.h> #include <stdlib.h> #include <conio.h> char op; And I'm asking the user to enter a character: printf("\nDeseja realizar novo teste (s/n) ?"); op = getche(); If the us...
asked by 10.05.2017 / 23:01
2
answers

Program Ignoring Scanf

I need to create an algorithm as a request below, however, every time I run the program it "skips" steps. For example: I want you to stay like this Product: "Potato" Sector: "Food" Quantity: "15" Price: "15.23" But it prints on...
asked by 13.05.2018 / 22:12