What is the output of the following C program segment Assume
What is the output of the following C++ program segment? Assume all variables are properly declared. for (int j = 0; j
Solution
Question 1:
0 -24
25 -49
50 -74
75 -99
100 -124
125 -149
150 -174
175 -200
Question 2:
int sum(int number)
{
int temp,sum = 0;
while(number)
{
temp = number%10;
sum = sum+temp;
number = number/10;
}
return sum;
}
Question 3: Answer to visible questions.
int alpha[15];
cout << alpha[9];
alpha[4] = 35;
