Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int sumfunc(int i);
- int main(void){
- int n;
- printf("Enter n = %d\n", n);
- scanf("%d",&n);
- /* I HAVE TO DO SOMETHING HERE????*/
- printf("The sum of the integers from %d to %d is %d", m, n, sum);
- return 0;
- }
- int sumfunc(int i)
- int n, m=1, i,sum, result;
- scanf("%d",&n);
- if(n>=0){
- for(i=0;i<=n;i++){
- sum += i;
- }
- }else if (n < 0){
- for(i=n;i<0; i++){
- sum+=i;
- }
- m = -1;
- }
- else{
- sum=0;
- m=0;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement