#include<iostream>
#include<vector>
std::vector<size_t> multiples(size_t const num, const size_t terms)
{
std::vector<size_t> result;
size_t term=0;
while (++term<=terms)
result.push_back (num*term);
return result;
}
int main()
{
const std::vector<size_t> mults = multiples (42, 5);
std::cout << "The first 5 multiples of 42 are:";
for (auto value : mults) std::cout << '\t' << value;
std::cout << std::endl;
}
Here's a simple Java program that uses a for loop to generate the first 10 multiples of the first 10 natural numbers: public class Multiples { public static void main(String[] args) { for (int i = 1; i <= 10; i++) { System.out.print("Multiples of " + i + ": "); for (int j = 1; j <= 10; j++) { System.out.print(i * j + " "); } System.out.println(); } } } This program iterates through the first 10 natural numbers and prints their multiples from 1 to 10.
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
write a c++ program to convert binary number to decimal number by using while statement
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
how to write a program that counts automorphic number from 1 to 999
Write the first 6 Multiples of 12 and 14.
Here's a simple Java program that uses a for loop to generate the first 10 multiples of the first 10 natural numbers: public class Multiples { public static void main(String[] args) { for (int i = 1; i <= 10; i++) { System.out.print("Multiples of " + i + ": "); for (int j = 1; j <= 10; j++) { System.out.print(i * j + " "); } System.out.println(); } } } This program iterates through the first 10 natural numbers and prints their multiples from 1 to 10.
Algorithm: multiples input: two positive integers, m and n output: print first n multiples of m i = m; for j = 1 to n print i i = i + m; next j
The first 3 multiples of 7 are: 7, 14, and 21.
write the first three common. multiples of 3,4,5
Example: Find the LCM of 12 and 30.Write the multiples of 12: 12, 24, 36, 48, 60, 72, ...Write the multiples of 30: 30, 60, 90, ...The first number you find which is in both lists is the LCM: 60.
Even multiples of 5 must end with a zero.
Write a program to convert a 2-digit BCD number into hexadecimal
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
Multiples of a Hundred thousand have a number followed by 5 zeroes Example: 300,000 400,000
There is no largest number. You can just keep going.
Least common multiple of 8 and 10 is 40 that's like this write down multiples of the whole number 8 first, they are 8,16,24,32,40,48,56,64,72,80,88 etc.. now write down multiples of the whole number 10,they are 10,20,30,40,50,60,70,80,90 etc...... as you can see 40 and 80 are common multiples in the series but 40 is the smallest one hence it is the LCM of 8 and 10