global and local variables in c
#include <stdio.h> //local parameters take precedance to global//
/* global variable declaration */
int a = 20;
int main () {
/* local variable declaration in main function */
int a = 10;
int b = 20;
int c = 0;
printf ("value of a in main() = %d\n", a);
c = sum( a, b);
printf ("value of c in main() = %d\n", c);
return 0;
}
/* function to add two integers */
int sum(int a, int b) {
printf ("value of a in sum() = %d\n", a);
printf ("value of b in sum() = %d\n", b);
return a + b;
}
Also in C:
- sidebar materializecss
- c program to swap two arrays
- grep find and replace
- how to pass props to higher order component
- c \a
- what is string::npos
- where is /dev/kvm
- print long in c
- update os ubuntu terminal
- c matrix sintax
- java.lang.SecurityException: Permission denied (missing INTERNET permission?)
- sublime text
- hopw to check how many duplicates in an array c
- linux kernel write()
- pow() c
- latex noindent
- c remove element from array
- clear screen c
- factorial c program using for loop
- PS1 modified lags
- toggling setting clearing checking changing a bit in c
- casting in c
- triangulo
- uint32_t extract first bits