ing C not(C++ or C#) without the use of strings and arrays, I need help in coding this small function as part of practice. We cant use any other library (like math.h) apart from stdio.h) We cant change any parameters. ** TO DO: Create the implementation for this function. * This function returns the updated number after the nTimes number of iterations. It also * displays the rotated number for each iteration. Note that for each iteration, * the leftmost digit becomes the the rightmost digit. * For example, if num is 456 and nTimes is 1, the function displays 1: 564 and returns 564. * Another example is if num is 709134 and nTimes is 3, the function displays * 1: 91347, 2: 913470 , 3: 134709 and returns 134709. * @param num the original number to be rotated * @param nTimes the number times num will be rotated to the left * @return rotated number (For this practice program, I have to utilize this function -) int getPlace(int num) { int t = 1; while(num>0) { t = t*10; num/=10; } return t/10; } } // The Particular Function// int rotateLeft(int num, int nTimes) { }
sing C not(C++ or C#) without the use of strings and arrays, I need help in coding this small function as part of practice. We cant use any other library (like math.h) apart from stdio.h) We cant change any parameters.
** TO DO: Create the implementation for this function.
* This function returns the updated number after the nTimes number of iterations. It also
* displays the rotated number for each iteration. Note that for each iteration,
* the leftmost digit becomes the the rightmost digit.
* For example, if num is 456 and nTimes is 1, the function displays 1: 564 and returns 564.
* Another example is if num is 709134 and nTimes is 3, the function displays
* 1: 91347, 2: 913470 , 3: 134709 and returns 134709.
* @param num the original number to be rotated
* @param nTimes the number times num will be rotated to the left
* @return rotated number
(For this practice program, I have to utilize this function -)
int getPlace(int num)
{
int t = 1;
while(num>0)
{
t = t*10;
num/=10;
}
return t/10;
}
}
// The Particular Function//
int rotateLeft(int num, int nTimes)
{
}
Step by step
Solved in 2 steps with 1 images