Ruby
xxxxxxxxxx
require 'set'
Vegetable=Set.new(["potato","brocolli","broccoflower","lentils","peas","fennel","chilli","cabbage"])
Fruits = Set.new(["Apple","Mango","Banana","Orange","Grapes"])
Vegetable.merge(Fruits)
count = 0
Vegetable.each do |element|
count = count + 1
end
puts "The number of elements present in the set are #{count}"
The number of elements present in the set are 13
C - Find Largest Number Using Dynamic Memory Allocation
Linux - How to Install anc-api-tools
Java - Reverse a Number
Python - How do I sort a dictionary by value?
Kotlin - Find Factorial of a Number
Java - Concatenate Two Arrays
Linux - How to Install zlib1g-dev
Linux - How to Install curvedns
C++ - Check Whether a Number is Prime or Not
PHP - Associative Array in Ascending Order by Value
Kotlin - Get Current Date/TIme
JavaScript - Count the Number of Vowels in a String
Kotlin - Calculate the Sum of Natural Numbers
Kotlin - Check Whether a Number is Even or Odd
GoLang - If/Else
Kotlin - Calculate the Power of a Number
Java - Create Pyramid and Pattern
Python - I/O chat very easy chat
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month