R_Prac-5.r (384B)
1 # Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 25 Mar 2026 2 # Repo: https://github.com/notamitgamer/bsc 3 # License: MIT 4 5 # Program to count the number of even numbers stored inside a vector of numbers. 6 7 print("Enter your numbers: ") 8 nums <- as.integer(scan()) 9 count = 0 10 for(i in nums) { 11 if(i %% 2 == 0) { 12 count = count + 1 13 } 14 } 15 print(paste("Even Count=", count))