lesson 13 lclname c
[[lesson_13_lclname_c]] last edit on
Aug 18, 2005
7:13 AM
by rescued_by_c
[user02@FC4 Lesson13]$ cat -n lclname.c
[user02@FC4 Lesson13]$ ./lclname
1001 + 2002 = 3003
[user02@FC4 Lesson13]$
1 #include <stdio.h>
2
3 int add_values(int a, int b)
4 {
5 int value;
6
7 value = a + b;
8
9 return(value);
10 }
11
12 int main(void)
13 {
14 int value = 1001;
15 int other_value = 2002;
16
17 printf("%d + %d = %d\n", value, other_value, add_values(value, other_value));
18
19 return 0;
20 }
[user02@FC4 Lesson13]$ gcc -std=c99 -o lclname lclname.c[user02@FC4 Lesson13]$ ./lclname
1001 + 2002 = 3003
[user02@FC4 Lesson13]$