R Program to print a table of any number


In this program, You will learn how to print a table of any number in R.


14 28 42 56 70 84 98 112 126 140

Example: How to print a table of any number in R

{
  t <- as.integer(readline(prompt = "Enter a Number :"))

  for (num in 1:10)  {
    print(paste(num * t))
  }
}

Output:

Enter a Number :4
[1] "4"
[1] "8"
[1] "12"
[1] "16"
[1] "20"
[1] "24"
[1] "28"
[1] "32"
[1] "36"
[1] "40"

Xiith is created for educational, experimental, and schooling purpose. Examples on Xiith are made easier to make a better or basic understanding. Tutorials, testimonials, and examples are continuously checked to avoid delusion, but we cannot take complete responsibility of all programs on Xiith. When you are operating this site, you have to agree to read and accept our terms of use, cookie and privacy policy.Copyright © 2020 by Xiith. All Rights Reserved. About us.