0% found this document useful (0 votes)
17 views

Notes

C is a simple yet powerful programming language with features that make it efficient, portable, and structured. It supports basic data types, operators, and control structures. Code can be broken into multiple source files and compiled separately, then linked together. Variables can be declared globally or locally, with globals accessible anywhere but locals only within their function. C is case-sensitive and has separate compilation enabling faster builds.

Uploaded by

coderasylem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Notes

C is a simple yet powerful programming language with features that make it efficient, portable, and structured. It supports basic data types, operators, and control structures. Code can be broken into multiple source files and compiled separately, then linked together. Variables can be declared globally or locally, with globals accessible anywhere but locals only within their function. C is case-sensitive and has separate compilation enabling faster builds.

Uploaded by

coderasylem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Features of C language:-

The C programming language is a feature-rich programming language. It has all the required features
that a developer (beginner or expert) would want a programming language to have. Let's talk about all
these features one by one.

Simple and Efficient: -

The C Language is a simple language that is easy to learn even for a beginner and is super-
efficient to use both in terms of the time of development and time of execution.

The scope of C language is also less so you won't get confused like in Python which has many
popular libraries (you keep thinking about which one to learn).

Portability: -

If you have a software written in the C language for Unix OS, and you now want to run it on
Windows OS, you can easily adapt the software for Windows OS, and that is the power of the C
language.

Hence, we can say that the C language is portable.

Structured Programming language: -

C language is a structured programming language because we can create functions in the C


language.

Using functions, we can separate a particular operation from the main program and then use it
again and again.

A structured language is not just about having the ability to create functions, but it
supports loops, conditional statements, etc.

Powerful: -

It has a broad range of features like support for many data types, operators, keywords, etc., that
allows the structuring of code using functions, loops, decision-making statements, etc.

Using the C language, you can easily read, write and create files.

Separate Compilation: -

A small piece of code will compile faster while a large code will take time to get compiled.

In C language you can break your code and put it in multiple source code files. C language will
compile the files separately and then link them together for execution. This makes compilation
fast.

Case-sensitive Language: -

In C, the uppercase and lowercase characters are different. That means if is not the same as IF in C
language.
Local and global variable :-
What is a Global Variable?
=> Global variables are those variables which are declared outside of all the functions or block and can be
accessed globally in a program.

=> It can be accessed by any function present in the program.

What is a Local Variable?


=> Variables that are declared within or inside a function block are known as Local variables.

=>The lifetime of the local variable is within its function only, which means the variable exists till the
function executes. Once function execution is completed, local variables are destroyed and no longer exist
outside the function.

Difference between global and local variable.

Global Variable Local Variable

Global variables are declared outside all the function Local Variables are declared within a function
blocks. block.

The scope remains throughout the program. The scope is limited and remains within the
function only in which they are declared.

Any change in global variable affects the whole Any change in the local variable does not affect
program, wherever it is being used. other functions of the program.

A global variable exists in the program for the entire A local variable is created when the function is
time the program is executed. executed, and once the execution is finished, the
variable is destroyed.

It can be accessed throughout the program by all the It can only be accessed by the function
functions present in the program. statements in which it is declared and not by the
other functions.

If the global variable is not initialized, it takes zero by If the local variable is not initialized, it takes the
default. garbage value by default.

Global variables are stored in the data segment of Local variables are stored in a stack in memory.
memory.

We cannot declare many variables with the same We can declare various variables with the same
name. name but in other functions.

You might also like