Programming Language-C
Did you know that Dennis Ritchie created the programming language C in the 1970s? It's still widely used and considered highly influential in programming. Many developers consider C the "mother language" of all modern programming languages.
- Let us begin with getting familiar with the datatypes that are dealt in C. There are two types of data types in C.
- Depending on the declaration of a variable in C, there are two types of variables. They are as follows:
- Global variable: This variable is assigned outside the main() function of C.
- Local variable: This variable is assigned inside the main() function of C.
#include <stdio.h>
int r = 8; // global variable
int main()
{
int f =13; //local variable
}
N.B: Every C statement ends with a semicolon ;
You can see that I used "include " in the above code. It's a mandatory header file library that allows us to work with input/output functions like 'printf()' for displaying our desired output.
#include <stdio.h>
int main() {
printf(" Henlo World");
return 0;
}
Any code inside main()'s curly bracket is considered the notebook and it will be executed as per instruction. Here "return 0;" ends the main() function.
Top comments (2)
if we dont use the return function what will happen ?
I don't know.