using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace printnumber
{
class Program
{
static void Main(string[] args)
{
int i;
for (i = 0; i < 20; i++)
{
Console.Write(i);
Console.Read();
}
}
}
}
Oh, dude, to print those numbers in QBasic, you can use a simple loop. Just loop from 1 to 5 and print the numbers with spaces in between. It's like making a sandwich, but with numbers instead of bread and cheese. So, like, don't stress, just code it up and hit run. Easy peasy, right?
11
it is int n=123; printf ("%d", (n/10)%10);
num%=9 CLS PRINT "The square of: "; num%; " = "; num%*num% END
10
For N = 1 to 10 Print 2 * N Next N
//program to find the factorial value f any number using while loop #include<stdio.h> void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&n); i=n; while (i>=1) { fact=fact*i; i--; } printf("The factorial value=%d",fact); } the above is a program for calculating tha factorial value of any number which is entered by the user
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.
Oh, dude, to print those numbers in QBasic, you can use a simple loop. Just loop from 1 to 5 and print the numbers with spaces in between. It's like making a sandwich, but with numbers instead of bread and cheese. So, like, don't stress, just code it up and hit run. Easy peasy, right?
Declare num number(10):=&num; a number(10); counter number:=1; begin for i in 1..10 LOOP a:=num*counter; DBMs_output.put_line(a); Counter:=counter+1; end loop; end;
11
10 CLS 20 FOR n = 1 to 10 30 PRINT n, n^2, n^3 40 NEXT n 50 PRINT: PRINT: PRINT "Touch 'x' to go again, any other key to end." 60 INPUT a$ 70 IF a$ = "X" or a$ = "x" THEN 10 80 END
Using for loop we can find sum of digits of a number. Inside the loop just perform Logic Expression 1) rem=num%10. {To find the unit place no. using remainder functon} 2) sum = sum+rem {to find the addition ie output} 3) num=num/10 {to eliminate the added digit} Just repeat these steps in the loop.
it is int n=123; printf ("%d", (n/10)%10);
cls input "enter a name"; a$ b=1 while b <=1 print a$ b = b+1 wend end
num%=9 CLS PRINT "The square of: "; num%; " = "; num%*num% END
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.