Math, asked by Manngrag1089, 6 months ago

What is sum of all integers from -500 to 500?

Answers

Answered by sravanthisabavath033
0

Answer:

please give me brainliest marks please please please

Answered by nilamkumari91229
4

Answer:

List the sum of numbers that are multiples of either 3 or five, below a given number.

Here's my code, couldn't find anything unnecessary. But hackerrank says it has terminated due to time out, time limit is 2 seconds to give the expected output. Input first line contains 't' that denotes the number of test cases. This is followed by lines, each containing an integer.

#include <stdio.h>

void calc(int a){

int sum = 0;

for(int a0=1; a0<a; a0++){

if(a0%3==0 || a0%5==0){

sum+=a0;

Similar questions