Capgemini interview question

Write a lambda function for incrementing an array values. Write a program for filtering prime numbers in a array and storing it in a vector array. Write a program to print the last 5 greatest numbers in an array.

Interview Answer

Anonymous

Feb 1, 2022

Written a lambda function for incrementing the elements in an array. Program : filtered the primes which are not divisible by any numbers except 1 and that prime and stored in a vector array. Program : sorted the given array and printed last five elements

3