Write a R program to add two vectors of integers type and length 3.
x = c(10, 20, 30) y = c(20, 10, 40) print("Original Vectors:") print(x) print(y) print("After adding two Vectors:") z = x + y print(z)
Sample Output:
[1] "Original Vectors:" [1] 10 20 30 [1] 20 10 40 [1] "After adding two Vectors:" [1] 30 30 70
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer