@Dave1/

LameCrispMining

C

No description

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>

/*//write a function that adds two values and returns the sum
// returntype identifier parameters

int addNums(int x,int y)
{
  int sum = x + y;
 y = 9;
  return sum;
}

int main()
{

  int x = 7, y = 12;
  printf("x = %d\ty = %d\n", x, y);
  x = addNums(x,y);
  printf("x = %d\ty = %d\n", x, y);

  return 0;
}*/

//write a function that adds two values and returns the sum
// returntype identifier parameters

int addNums(int x,int y)
{
  int sum = x + y;
  y = 9;
  x = 11;
  printf("x = %d\ty = %d\n", x, y);
   printf("x = %d\ty = %d\n", x, y);
  return sum;
}

int main()
{

  int x = 7, y = 12;
  printf("x = %d\ty = %d\n", x, y);
  x = addNums(x,y);
  printf("x = %d\ty = %d\n", x, y);

  return 0;
}