Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18, adds 1 to the variable adults if age is 18 through 64, and adds 1 to the variable seniors if age is 65 or older. {Ans: if(age<18){ minors = minors + 1; }else if(age>17&&age<65){ adults = adults + 1; }else{ seniors = seniors +1; }}write the definition of a function twice, that receives an integer parameter and returns an integer that is twice the value of that parameter {Ans: int twice(int input) { return input*2; }}Given the integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another integer variable min. Assume that all the variables have already been declared and that x, y, and z have been assigned values ). {Ans: if(x < y){ if(xNOTE: in mathematics, the square root of a negative number is not real; in C++ therefore, passing such a value to the square root function is an error. Given a double variable named