I'm writting a piece of code that will use global and local values. Although when i try to compile it will not let me pass values to different functions. what am i doing wrong
Code:#include <stdio.h> int a, b; long int c, d, total; int main() { total = inputnumbers(); printf("The sum of these numbers is %i", total); } int inputnumbers() { printf("Please enter integer 1 : "); scanf("%i", &a); printf("Please enter integer 2 : "); scanf("%i", &b); printf("Please enter long integer 1 : "); scanf("%i", &c); printf("Please enter long integer 2 : "); scanf("%i", &d); return addints(a,b,c,d); } int addints(int w, int x, long int y, long int z) { long int sum; sum = (long)w + (long)x + y + z; return sum; }



LinkBack URL
About LinkBacks




