
#include <stdio.h>
int main ()
{
long num;
long sum = 0L;
int a;
printf ("plesase enter an integer to be summed (q to quit):");
a = scanf ("%ld", &num);
while (a == 1)
{
sum = sum + num;
printf ("please enter next integer: ");
a = scanf("%ld", &num);
}
printf ("Those integers sum to %ld\n", num);
getchar ();
getchar ();
return 0;
}
int main ()
{
long num;
long sum = 0L;
int a;
printf ("plesase enter an integer to be summed (q to quit):");
a = scanf ("%ld", &num);
while (a == 1)
{
sum = sum + num;
printf ("please enter next integer: ");
a = scanf("%ld", &num);
}
printf ("Those integers sum to %ld\n", num);
getchar ();
getchar ();
return 0;
}
