answersLogoWhite

0


Best Answer

Input a variable.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you alternate the input numbers using for loop in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Sum three real numbers using for loop in c program?

take input n chodo


When you input data in a loop within a program the input statement that proceeds the loop is what?

is called a priming input


How do you insert value to a dropdownlist from textbox input php?

Store the textbox input in a database using a html form prefarably. Using a loop get all the textbox input from database and use print/echo to show them in a dropdown.


What is an open loop?

Output is obtained for a given input and we cant control the output my means of any feedback loop control to the input


To find biggest of four numbers using if else loop?

largest number a,b,c,d


Wright The numbers from 1 to 10 in descending order using loop?

int i; for (i=10; printf ("%d\n", i); i--);


How would I add numbers input by a user one at a time into a vector in MATLAB I have the loop set up but don't know how to add the data into the vector?

First, make sure your vector is initialized outside of the loop. Then, within your loop you need to update the vector. If you want data entered by the user only, you should initialize with an empty vector. Example program (not sure which loop you're using, but I'll use a while loop here): vector=[]; user='y'; while user=='y' user=input('Enter another variable? Type y for yes and n for no: '); if user=='n' break end var=input('Please input variable: '); vector=[vector, var]; end The key part in this coding is the line: >> vector=[vector,var]; as this will update your vector with the previous vector values, and then add another value to the vector with whatever number var is. Hope this helps!


How do you perform multiplication of two numbers without using the multiplication operator?

By using repeated addition. Consider two numbers a and b. If you want to find a*b then you can add the numbers repeatedly in a loop to get the product. Eg:product = a;for( i=1; i


How do you print 1 to 100 without using loop in php?

The best way to print the numbers 1 to 100 in PHP without using a loop is with the following code: echo implode("<br>", range(1,100)); You can replace the <br> with anything that you want to separate the numbers, such as dashes. I used a line-break in the example.


How do you input 5 numbers and out put the sum and print these numbers in the inverted order using array structure?

Declare the arrayuse a for loop going from 0 to 4within that loop, ask a question, and store it in the array at the current indexstart another for loop going from 4 to zeroin that loop output the questions.For instance, if you're doing it in C, it would be something like this:#include int main(int argc, char *argv[]){int answer[5], n;for(n = 0; n < 5; n++){printf("Gimme a number: ");scanf("%i", &answer[n]);}for(n = 4; n >= 0; n--){printf("%i\n", answer[n]);}return 0;}


Is a sound card a input or output?

It is both input or output


What is priming input?

A priming input, also known as priming read, is the statement that reads the first input data record prior to starting a structured loop.