Create a function (prob3_6) that will do the following: Input a positive scalar integer x. If x is odd, multiply it by 3 and add
1. If the given x is even, divide it by 2. Repeat this rule on the new value until you get 1, if ever. Your program will output how many operations it had to perform to get to 1 and the largest number along the way.
Create a function "prob3_6" in this function we passing an integer parameter of type "int" named "k".
Inside that function we declared a variable "c" of type "int" that is used for counting purpose .
After that we iterated the while for print the value of when it is not equal to 1 .
We check if condition when k gives 0 on modulus then k is divisible by 2 otherwise else block will be executed in the else part we multiply by 3 to k and add 1 to the k variable .