1#include <stdio.h> //local parameters take precedance to global//
2
3/* global variable declaration */
4int a = 20;
5
6int main () {
7
8 /* local variable declaration in main function */
9 int a = 10;
10 int b = 20;
11 int c = 0;
12
13 printf ("value of a in main() = %d\n", a);
14 c = sum( a, b);
15 printf ("value of c in main() = %d\n", c);
16
17 return 0;
18}
19
20/* function to add two integers */
21int sum(int a, int b) {
22
23 printf ("value of a in sum() = %d\n", a);
24 printf ("value of b in sum() = %d\n", b);
25
26 return a + b;
27}