State the output of the following code segment: [2]
int n=123;int q=10,r=0;
while(n>0)
{
r=n%10;
n=n/10;
q++;
}
Answers
Answered by
1
Explanation:
int n, total; n=10; //n can be initialized to any +ve number total=0;. sumUp(n, total); ... p=10 and q=66. - When method origin1() is invoked the parameter p ... variables p=0, q=0), and p starts referring to the new object.
Similar questions