I'm having an error, when it reaches the answer, it always gives me 0!!! I attatched the image of the error, as well as the C file where it resides.
Code:
#include <stdio.h>
int main ()
{
int r = 0;
int l = 0;
int b = 0;
int i = 0;
int n = 0;
int a = 0;
printf(" MARIOTUTORIALS CALCULATOR\n");
printf("\n");
printf("\n");
printf("\n");
printf("[1] Add\n");
printf("[2] Subtract\n");
printf("[3] Multiply\n");
printf("[4] Divide\n");
printf("\n");
printf("\n");
printf("Choose a number: $~ ");
scanf("%d", &n);
getchar();
if(n == 1)
{
printf("\n\nHow many numbers do you wish to add? ");
scanf("%d", &a);
}
for(i=0; i < a; i++)
{
printf("Your Number(s): ");
scanf("%d", &l);
int b = l + b;
}
printf("\n\nANSWER: %d", b);
getchar();
return(0);
}