icp/oer/courses/example-course/sections/01-introduction/02-c-add/solution.c

21 lines
333 B
C

#include <stdio.h>
#include <stdlib.h>
int add(int a, int b) {
//TODO: change so that the sum of a and b is returned
return a + b;
}
int main(int argc, const char *argv[])
{
int a, b, result;
a = atoi(argv[1]);
b = atoi(argv[2]);
result = add(a, b);
printf("The sum of a=%d and b=%d is %d\n", a, b, result);
return 0;
}