Computer Science, asked by Vishurj8035, 1 year ago

Create a sequence of even numbers between 1 to 10, iterating the sequence twice. This needs to be written in R

Answers

Answered by sailorking
1

To solve the question in java we have to do the following:-

for ( int j = 1 ; j < = 2 ; j + +)

for( int i = 0 ; i < = 10 ; i = i + 2 )

{

  R = i ;

   System . out . println ( R + "  " ) ;

}

Here the initial value of the control variable j set to 1 which shall  execute twice and the inner loop contains the printing sequence of even numbers.

Answered by indusharma123
26

In R :-

a<-rep(c(2,4,6,8,10), times=2)

a

Similar questions