Skip to main content

"C Basics"

C language was created by "Dannis Richie" in 1970 at "bell lab". C Language is the base of many languages:
1.B language
2.COBOL language
3.Pascal language
Since C language is a case sensitive language(where case sensitive means it differ in capital and small letters,that is it has different meaning if we write a word "Print"and has different meaning if we write it as "print".)
That is it depends on :
1.Lower case and
2.Upper case.
Now in different countries different languages are spoken so a language is composed of letters (for e.g. in English a,b,c etc.) Just like these languages C language is composed of letters,characters,numerics,special character's etc.
Now I will give the description of these letters , special characters etc.

1.Characters: It include characters of English that is from A(capital) to z(small). So a total of 52 characters are used in C language.

2. Numerics: In C language a total of 10 numerics are used that is from 0 to 9.

3. Special symbols: Special symbols include (),[],{},#,$,%,&,@,*,!,?,",'',-,+etc. So a total of 29 special symbols are used in C language which we will discuss in our next classes.

4. Formatting characters: So a total of 5 formatting characters are used in C language and few of them are backspace, enter etc. and others characters we will discuss in our upcoming session when we start making programs.

Since these are the characters , symbols which are used in C language beside these there are two special symbols which are not used commonly and these are @ and $.
NOTE:--
In todays world C language is not commonly used because now different other type of languages i.e. high level languages are used for programming.

              Output Manipulaters

There are some characters with special symbols which when used together give us a special symbols which are used to manipulate the output of a given program these are called output manipulaters. Some of them are discussed below:
1. \n (new line character)
 Now we will understand the meaning of this manipulater.
Now take an example in which we have to print the value of three no's simultaneously.
Let three no be
a=5
b=10
c=15
Now if we need to print these as output we will do as:
Note:-- this is just an example in this we will not understand the programming if u r new so just understand the meaning of the manipulates and nothing else.
Printf("%d%d%d",a,b,c);
The output come out to be as 51015.

So by this output we will not able to understand what is the value of a ,b ,c because it gives us output as a no. which cannot be understand by anyone.
So let us use the first manipulater as:
Printf("%d",a);
Printf("\n");
Printf("%d",b);
Printf("\n");
Printf("%d",c);

And the output comes out to be as :
5
10
15
Now it is the correct way or we can say that it manipulates our output.

2. \t (tab space)
We will use it as in the same way as in the above example, so take the above example.
Printf("%d",a);
Printf("\t");
Printf("%d",b);
Printf("\t");
Printf("%d",c);
And the output comes out to be as
5    10   15
ultimately it changes the our output, so it is also a output manipulater.

                      White Spaces
Since when we perform our programs in softwares ,it is a blue screen the program is written in  the screen and the spaces which left out are called white spaces.

Use of white spaces:
These spaces are used to write comments (i.e. in oder to describe the program) also to make program user friendly.
There are two types of ways to write white spaces in a program and these are:

1. Single line : which are used when we have to use only one line. It is represented as //.

2. Multiple line: which are used when we have to use multiple lines. It is represented as /*.
If u running ur program in a software the words written after /*are printed as it is but if wanted to start our program after this we have to close it as*\ then we can start our program.

Any questions please write it in the comments and I will try to solve it.



By sudhanshu tidyal

Comments

Popular posts from this blog

How nanobots are used as artificial blood?

Nanobots are actually nano-robots  , those robots whose parts are in the size of nanometers. The application of these nanobots is this that they can be used in those areas where it is difficult for human hands. Since now in human body artificial blood can be used which is made of these nanobots . Just like human blood which consist of 1. Red blood cells 2. White blood cells 3. Platelets Function of RED BLOOD CELLS 1. Haemoglobin transports about 97-98% of oxygen from lungs to body tissues as oxyhaemoglobin. 2. Haemoglobin also transports about 23% of carbon dioxide from the body tissues to the lungs as carbaminohaemoglobin. FUNCTION OF WHITE BLOOD CELLS 1. Neutrophils act as soldiers gaurding the body . They eat up invading microbes by phagocytosis.  2. Basophils secrete heparin which prevents coagulation of blood in the blood vessels. 3. Monocytes act as scavengers and eat up damaged and dead cells to keep the body clean. 4. Acidophils help in healing of...

Use your spare time in earning money through online apps

Now here are the 5 apps which you can use to earn money online 1. Flikk      It's an online app of 5.6 megabyte having a rating of 4.4 and downloaded by 5 million people overseas. Now with the help of this app you can perform alot of things with it's features some of them are: 1. It runs on two basic languages which are Hindi and English. 2. With this app you can watch live cricket scores, and stay updated with top stories . 3. It also give gureanteed mobile recharges up to $1.5 every day. 2. Task   bucks     Its an online app of 7.2 megabyte having a rating of 4.4 and downloaded over 10 million overseas. This app gives us tasks and with the completion of tasks we can earn money as: 1. Get paytm cash everyday complete a task &get up to 💯 Rupees in a day. 2. The reward you earn it can be transferred to your paytm wallet. 3. It offers us with free recharges & bill payments by completing tasks. 4. You can play quiz and can win 50 r...

c program for swap two numbers by two ways

We can write the c program for swap in two  ways: 1. by using only two variable, 2. by using three variable. In first we will discuss our first type program i.e. by using only two variable. in this program only two variables are used to swap two numbers, in order to write a program we need to build a logic and after that the program will run. 1.firstly try to solve this program on your own 2.after this try to understand the problem i.e. to swap two numbers 3.now build a logic between two numbers       a=1,b=2    if i write a=b & b=a this is WRONG  way. why this is wrong? A question comes in mind. This is due to the  reason that when a=b (means the value in b is assigned to a) then the value in a will vanish. Now when we wite b=a(means the value in a is assigned to b) but from the above line we came to know that the value of a is vanished and the the value which is in a is of b. so the proper way of making a relation betwee...