answersLogoWhite

0


Best Answer

Any type will do, here is an example:

for (leave= 0, nnum= 0; ! leave; ) {

rc= scanf ("%d", &number);

if (rc!=1 number==-1) { leave=1; continue; }

++nnum;

... do something with number ...

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What type of loop is used to write a program that prompts the user for a value until the user enters -1?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What type of loop is used to write a program that prompts the user for a value?

A do-while loop. Example: // Returns a user-input value in the half-closed range: [min:max) unsigned input_value (unsigned min, unsigned max) { assert (min<max); // pre-condition! unsigned value; bool success; success = false; // repeat until success is true do { printf ("Enter a value: ", min, max); scanf ("%u", &value); if (!success = (min<=value && value<max)) printf ("\n%u is out of range.\n", value); } while (!success); assert (min<=value && value<max); // post-condition! return value; }


Write a complete well-documented C language program The program should repeatedly ask for another input of a non-negative real number ie X until a negative value is inputted and the program then?

Yes, do that, because it is your homework.


What property value will be displayed in a dialog box if the user enters an invalid value?

A Validation Text Property


Program for finding a minimum value in javaprogram for finding a minimum value in java?

program for finding a minimum value in javaprogram for finding a minimum value in java


FA Charity Shield 1978 Program value?

1986 League Cup final program value?


Is it true if a user enters a value that is invalid excel has a retry option?

true


What is the logic for binary search in masm 8086 program?

Take the mid value of the no. of inputs. If the key is greater than the mid value then add the mid value and the last value; then divide by two. Again check the middle value for the key and keep repeating this until you find the key. If key is smaller than the mid value. Add the first value to the mid value and divide by two. You will find the new mid value to compare and check for the key. Loop it until you get the key location.


What is the value of a 1973 Chicago Cubs official program?

The value of a 1973 Chicago Cubs official program would depend on the condition of the program, who was on the cover, and if it was for a special game or event.


What would you get for Pele's last game program It was played in Giants stadium?

The value of any program from a sporting event is in the eye of the beholder. If you are not a fan of the player or the sports team there value of the program is worthless to you. Sports memorabilia collectors will find an appropriate value for you.


What should you do if you get garbage value?

Fix your program.


This is a value that is written into the code of a program?

literal


Was is value of a 1988 Chicago Cubs program from first night game?

The value of a 1988 Chicago Cubs program from their fist night is an estimated $15.00.