Question
Given an integer n, what does the following function compute?
int function(int n)
{
int i;
for(i = 0; n != 0; n %=10, i++)
return i;
}
Answer :
Word Count : 145
__________ _____ _______ ______ ____ ___ _____ __________ ______ ______.
_________ __________ ___ ____ ________ _______ __________.
_____ _____ ___ _________ _______ ___.
___ _______ _____ ___ ____ ____ ______ _____ _______ __________.
_____ _____ _____ ______ ___ _____ __________ _______ ________ _________ ___.
_________ _____ ________ _____ ______.
__________ ___ __________ ______ ___ _____ ___ _______ _____ _____ _________ __________.
_____ ____ ____ _________ ______.
________ ______ ________ _______ ____ __________ __________ _______ ________ _________ ___ _______.
_________ _____ __________ _________ ___ __________ __________ __________ ________ ______ ___.
________ _________ _______ ____ _____ _____ _____ _____ _________ ______ _________ ___.
____ ________ _______ __________ ________ _______ ____ ___ _________.
Skip in 10
The given function computes the number of digits in the integer n. Here's how it works:
- The function initializes an integer variable
ito 0. - It enters a loop, which continues as long as
_________ __________ ___ ____ ________ _______ __________.
_____ _____ ___ _________ _______ ___.
___ _______ _____ ___ ____ ____ ______ _____ _______ __________.
_____ _____ _____ ______ ___ _____ __________ _______ ________ _________ ___.
_________ _____ ________ _____ ______.
__________ ___ __________ ______ ___ _____ ___ _______ _____ _____ _________ __________.
_____ ____ ____ _________ ______.
________ ______ ________ _______ ____ __________ __________ _______ ________ _________ ___ _______.
_________ _____ __________ _________ ___ __________ __________ __________ ________ ______ ___.
________ _________ _______ ____ _____ _____ _____ _____ _________ ______ _________ ___.
____ ________ _______ __________ ________ _______ ____ ___ _________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.