int s =0;
for(int i =0 ; i<8;i++)
{
if ( i%2 == 0)
s=s+i;
else
s--;
Sopln(s);
}
what will be the output ?
if you spam i'll report your account as well as the answer. ❌
Answers
Answered by
1
Answer:
Enter any number and check whether it is even or odd, if it is even then print the sum of factors.
Explanation:
The program you have written has errors so, I corrected it and if you enter a number and the remainder does not comes 0 then the number is odd and if the remainder comes 0 then the number is even and if it comes even then the program will print the sum of the factors of the number you have inputted in the program.
Attachments:
Answered by
0
Kindly refer the attachments...
(Total no. of attachments = 3)
Attachments:
Similar questions
Math,
2 months ago
Science,
2 months ago
Computer Science,
2 months ago
Social Sciences,
4 months ago
English,
4 months ago
Math,
10 months ago
Math,
10 months ago
Computer Science,
10 months ago