-1
I am making a program in C Language, but the site informs that the output of the program is not accepted.
Follows the code:
#include <stdio.h>
int main(){
int num1, num2, i, soma=0, temp;
scanf("%i", &num1);
scanf("%i", &num2);
if (num1 > num2) {
temp = num1;
num1 = num2;
num2 = temp;
}
for ( i = num1 ; i < num2+1; i++ ) {
if (i>=0) {
soma = soma + 1;
}
}
printf("%i", soma);
return 0;
}
Error print: Two screenshots of the error being displayed
What exactly makes you wrong? I tested it in a program and it works.
– IanMoone
One by one, if you want to add these two numbers together, it’s easier to just do
soma= num1 + num2;
and so does not need any cycle for– IanMoone
Hi, you could see the screenshots, it was shown that the program did not pass in 2 cases and do not know how to solve.
– betafico123