#include
void main()
{
int i=2,m,n;
printf("enter number");
scanf("%d",&n);
do
{
m=i*n;
printf("%d*%d=%d\n",n,i,m);
i=i+1;
}
while (i<=10);
}
Um, not sure how to do that, but you can create a sort of "table" in C++ by using multidimensional arrays. Below is an example of how to create a two-dimensional array: int myArray[10] [10]; You can add more dimensions to the array in order to increase its storage capacity.
a = 0while a < 10 :a += 1print (a)Write the above simple script in a text editor (I use nano). Save as loop.py in home folder. To run, open a terminal and at the prompt, write: python loop.pyResult:rodney@downstairs:~$ python loop.py12345678910
If you want to execute a statement which is in while loop at least one time you can use do- while loop. this is why because initially first statements will be executed then condition will be checked. but in case of while first condition will be check then statements will be executed
Use a counted for loop. On each iteration, multiply the control variable by 2 and print the result.
finding quotient and remainder function table(){var num = parseInt(document.getElementById("num").value);var x =0;var i ;// document.write("tetseo");for(i=1;i
To create a multiplication table using PHP functions, you can define a function that takes a number as an argument and generates the table. Inside the function, you can use a for loop to iterate from 1 to 10 (or any desired range) and calculate the product of the input number and the loop index. You can then print each line of the multiplication result. Here’s a simple example: function multiplicationTable($number) { for ($i = 1; $i <= 10; $i++) { echo "$number x $i = " . ($number * $i) . "<br>"; } } multiplicationTable(5); // Example call This will produce the multiplication table for the number 5.
Algorithm: 1. From the user collect the integer whose table is required 2. Use a loop with loop counter starting with 0x01 and ends till the table value is required 3. start multiplication the input number with the loop variable and print the result.
Um, not sure how to do that, but you can create a sort of "table" in C++ by using multidimensional arrays. Below is an example of how to create a two-dimensional array: int myArray[10] [10]; You can add more dimensions to the array in order to increase its storage capacity.
The time complexity of using a while loop inside a for loop is O(nm), where n is the number of iterations of the for loop and m is the number of iterations of the while loop.
the multiplication of the number of iterations with the number of statements in that loop is equal to loop length.
To print multiplication tables in QBasic, you can use nested loops. The outer loop iterates through the numbers 1 to 10 (or any desired range), while the inner loop multiplies the current number by each number in the same range. Here's a simple example: FOR i = 1 TO 10 PRINT "Table of"; i FOR j = 1 TO 10 PRINT i; "*"; j; "="; i * j NEXT j PRINT NEXT i This code will display the multiplication tables for numbers 1 to 10.
a = 0while a < 10 :a += 1print (a)Write the above simple script in a text editor (I use nano). Save as loop.py in home folder. To run, open a terminal and at the prompt, write: python loop.pyResult:rodney@downstairs:~$ python loop.py12345678910
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
/*mycfiles.wordpress.com Program to prepare Table of any no. using while loop*/ #include #include void main() { int n,t,count=1; clrscr(); printf("Enter any number\n\n"); scanf("%d",&n); while(count<=10) { t=n*count; printf("\n%d*%d=%d",n,count,t); count++; } getch(); }
The syntax for writing a loop in pseudo code typically involves using keywords like "for", "while", or "do-while" to indicate the type of loop, followed by the loop condition and the code block to be executed within the loop.
If you want to execute a statement which is in while loop at least one time you can use do- while loop. this is why because initially first statements will be executed then condition will be checked. but in case of while first condition will be check then statements will be executed
#include using std::cout;using std::endl;int main(){int number(1);cout number;//using loop forint sum(0);for(int i(1); i