DEKHO - Header Ads

Tutorial on C Programming

 Tutorial on C Programming

C language is a high-level, general-purpose programming language that is great for creating firmware and portable applications. C language was created in the early 1970s at Bell Labs by Dennis Ritchie for the Unix Operating System (OS). It was originally designed for writing system applications.



Prerequisite


You can immediately start creating programmes on your system if you've developed computer programmes in any programming language, even simple c language programming code.




Audience


This tutorial is intended for both beginners and experts.


With a to z c language programming concepts in these tutorials, you can quickly study and comprehend our lessons since they are written in an easy and basic way.




Problems

If you've never developed a computer programme before, you'll need two basic resources: a review of programming fundamentals and a fast overview of computers and their primary components.




C Programming's History


C is a general-purpose language that is tightly linked to the UNIX operating system for which it was created, as the system and the majority of the programmes that run on it are written in C.


Dennis Ritchie, of Bell Laboratories, invented C in 1972.


C incorporates numerous principles from these languages, as well as the concept of data type and other advanced features.


since it was created in tandem with the UNIX operating system


It is closely linked to the UNIX operating system.


This operating system, which was also developed at Bell Laboratories, was almost entirely written in the C programming language.


UNIX is the heart of the internet data superhighway and one of the most widely used network operating systems today.


Dennis Ritchie is a writer, director, and producer.


C was mostly used in academic settings, but with the availability of multiple commercial C compilers and the growing popularity of UNIX, it began to gain general acceptance among computer professionals.


C is now available on a wide range of operating systems and hardware platforms.


The c programming syntax is fairly easy to learn and understand, as shown in the following basic example of c syntax.


C's Basic Syntax


main() 

Printf("Hello"); 


The Basics of C Syntax


The letter C is case-sensitive. The declaration int x differs from the declaration int X. Lower case letters must be used in all directions.


The semicolon ';' must be used at the conclusion of every statement.


Blanks and tabs are shown by white space.


Between keywords and identifiers, white space should be used.


Set of characters


The characters that make up the syntax of the C language are classified as follows:


Letters – This category includes all alphabets (a-z, A-Z).


Digits are numbers ranging from 0 to 9.


Semicolon (;), colon (:), period (.), underscore (_), ampersand (&), and other special characters are available in C.


Vacant Space


Identifiers for C


Identifiers are names in C programming that are used to refer to variables, functions, constants, and user-defined data. When creating identifiers, the following rules should be followed:


Only alphanumeric characters should be used in identifiers (a-z, A-Z, 0-9). The underscore (_) is the only non-alphanumeric character that can be used.


Only an alphabet or an underscore (_) can be used as the first character. A variable name cannot begin with a number (int 8var).


Case matters when it comes to identifiers. As a result, int var differs from int Var or int VAR.


Aside from the underscore, no special characters may be used in an identifier.


In C, variables

What exactly are variables?

In C programming, a variable is also known as a data container. The data types of variables can be used to identify the type of value stored. If we declare a variable to be of type integer, it can only store integer values. Variables are one of the building blocks of C programming, and they are also known as identifiers.


Variables: A Simple Example


main()

{

       Int a=10;

       printf(“The Value of a is %d”,a);

}



C variable naming conventions

1.The name of the variable must begin with a letter or an underscore.


2.Case matters when it comes to variables.


3.They can be made up of digits and letters.


4.Other than underscore, no special characters are permitted.


Variable names include 5.sum, height, and _value.


There are three different kinds of variables.


1.Variable at the local level


2. Variable at the global level


3.Variable in the environment






No comments

Powered by Blogger.