Computer Science, asked by tanishapaul1340, 1 month ago

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 Anonymous
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 kanvi14
0

Kindly refer the attachments...

(Total no. of attachments = 3)

Attachments:
Similar questions