Friday, 31 May 2019

How to write a c program?

After writing any program first we know about what is program? And
What are the essential rules for writing a program in c?

Program-: The collection or group of instructions & informations is called a program.

These are the some important rules for the writing a program in c--

1. Never use capital letters.
2. Use ; in last of statement.
3. Use variable to define parameters
   a, x, y, p, q.... ✔
   ax, bx, xy...... ✔
   x1, x2, x5...... ✔
   3x, 6x, 2x......❌
4. Header file should be included.
     Two header files must be included
First-
         #include<stdio.h>
    Stdio means standard input/output.
   Where .h is the extension of header file.
    The work of this header file is --
    In this files Printf() ; and scanf(); are         executed.
Second-
              #include<conio.h>
      Conio means console input/output.
       The work of this header file is--
      In this file getch() ; and clrscr();         are executed.
. The purpose of getch(); is to hold the output on the console.
. The purpose of clrscr(); is to clear all the trash data on the console.

5. If we take integer type value then we have to use
         Int
        0-9
        %d
     If we take float type value then we have to use
          float
           0.1,.57,.886
          %f
If we take charecter type value then we have to use
           Char
            a-z
             %s

6. Program will start from main().
7. After main(); start the program with curly braces {_}.
8.

Let's take an example of c program---
      #include<stdio.h>    
      #include<conio.h>
        main()
          {
             printf("my name is A.");
             getch();
           }
Output of this program is
   my name is A.
 

Note-:#<include> is pre processor command. This statement tells the pre- processors to include the information contained in the file stdio.h before it is past for the compilation.

main() - main is a special function name. Every c program has main function somewhere in the program. This function will be executed first when the program is run.
           &- is used for the address of the          value where stored.
            If you are writing a c program in turbo c software then
    To compile your program press Alt+f9
      To run the program press Ctrl+f9.

Wednesday, 29 May 2019

What are the basics of c?

In this language we can write our programs very easily.
After starting a c program first we can understand the steps which are given below⬇
1. Variable- variable is an entity whose value kept on changing throughout the program execution. We can easily change the value of any variable in whole program. It is very special case of the program. Hence it is not a rule that the value shall change. The value of variable can be same throughout the program execution.
Then we can discuss the defrences between constant and variable,
Here if we follow opposite rules of variable then we discuss about Constant it means that the value of constant might remain same throughout the program.
We can't change the value of constant in the program execution.

Let's take an example....

We defined the variable named v in a program. Let's say v=5.
After some time we can change the value of v to 7 or v to 9.
Now v=7 is getting change in the program. But we can't change the value of v if it defined as a constant.
2.Keyword-
The words whose meaning has already been defined in the c compiler is called
keyword.
The key word also called reserved words.
There are 32 keyword available in c.
-------------------------------------------------------------------
There are some keyword given below..
Int, float, char,auto, break, return, void, union, if, do, short, case etc.

I think you understand about keyword but the word compiler is new.
So we want to know about this word compiler is a device which converts users language into binary language.
Because we all know that computer reads or understand only binary language.

Friday, 17 May 2019

What is C?

C is a programming language.
The creator and designer of this language is an American named Dennis  M.Ritchie.
He written the c language at AT&T Bell Laboratories in USA 1972.
C has invented for writing the Unix operating system.
The c language formalized in 1988 by the
ANSI (American National  Standerd Institute).
The Unix, Linux and RBDMS MYSQL operating system were total written in c.
At that time many languages were using  as Basic, Algol, Fortran, Pascal etc.  These are low leval languages.But when c language came in the programmers country. Then progammers prefered c language to others.
It becomes very popular among the peoples.
We can also called it mother language because every language belongs to c language.
C is base of all computer languages.
If we learn about this language then we can understand the concepts of all programming languages.
           Features of c language
.It is case sensitive language.
.C is middle leval language.
.C is structured programming language.
.It can handle low-level activities.
.It can be compiled many variety of computer platforms.