Header Ads

MY FIRST PROGRAMMIG LANGUAGE C PROGRAMMING



C PROGRAMMING

Students Ham is site (A.V addiction) ke madym se apko bahut hi saral or asan tarike se C programming language sikhayege. Yaha  apko bina kisi ki help se aap C programming shikh sakte hai , or dusre students ko bhi Is site (A.V addiction ) ke bare me btaye taki we bhi apki tarha C programming sikh sake . 

Kisi bhi programming language ko padne ke liye hame pehle basic (knowledge) jankari  honi chahiye.
                                                        Start    
C Language makers are  Dennis Ritchie & Bell Labs‎
Language:-  language are two types .
     
                1.     Low level  language :- it is a two types  .
                a)    Machine language it is work on (0,1) from.
                b)    Assembly language it is work on (symbols).

       This language is hardware dependent , and not  a portable. 
               2.     High level language :-this language is a hardware independent ,and it is a portable.
      Example:- C , C++ , java , cobal , fortren , ruby etc.
Translater
 
           1.     Assembler :- it convert to assembly to machine language.
           2.     Interprite r:- it is check the program line by line and find the error in the line and it stop the reading.  It is convert high level to machine language.
          3.     Compiler :- it is check the program at a one time, and it  is convert high level to machine language.
     
C language 

C  language is middle level language or brige level  language.
Writer of C language:-
Ex.  Simple program of addition in C  language..??
#include<stdio.h>
#include<conio.h>
      void main()
{
int  a,b,r;
clrscr();
printf(“Enter two numbers”);
scanf(“%d%d”,&a,&b);
r=a+b;
printf(“Addition is =%d”,r);
getch();  
 }
 
Note:-  in this program we know the what is the concept mean.

#include                       =         pre processor directive  
stdio.h , conio.h           =        this is header file (console I/O key)  that is predefined.
void  main()                 =        void is a return type and main() is a user defined function
             
                {                             Beginning    
            -------------
            -------------               body of  main
            -------------
 getch();         =       showing results  of more time.            }
          }            =       end                                                     }
Int a,b;           =       that is variable.                                   }
clrscr();          =       it is use to clear the screen .               }      that is all predefine
sacanf           =      fetch the address of datas run time.       }
printf()          =     print the data                                          }

VARIABLE:- variable is the name of memory location which are hold any value.  the variable is a basic unit of storage in a C programming. Variable name may consist of alphabets, digits, the underscore( _ )  and doller character subject iot following conditions.

             1.     They must not begin the disit.
          2.     Variable name must be start alphabet .
          3.     Uppercase and lowercase are distinct (means alag-alag). Means  the variable    Total is not same , like TOTAL or total .
         4.     It  should be not a keyword.
         5.     Variable names can be of any length.
         6.     Space is not  allow. 
         7.     Keyword not allow for variable name.
 it is a four types of variable.

        a)    Local variable      =             ( Automatic)               (Garbage)             (Default  value)
     b)    Global variable      =           (External)                          -                                  0
       c)     Static variable      =            (Life time variable)        -                         0
Register variable  =       in this variable not use scanf because that is not use the memory only use the CPU  register  , this is a faster . 

DATA  TYPE :- Every  variable in C has a data type. Data type specify  the size and type of values that can be stored.

Integer :- 
   
                a)    It have a complete number .
                 b)    It must not have a decimal .
                c)     Space and special symbol not allow.
           d)  Two byte memory consume
Float :-
    
           a)     It is most have be decibel number.
           b)    Space and special symbol not allow.
      c)   It is a four byte consume.
 
Double:-

         a)    It is most have be decibel number.
         b)    Space and special symbol not allow.
         c)     It is a eight byte consume.       
Character : - 

    a)    Any alphabet , number or symbol with in single code.
        b)    One byte consume .
        c)     Rang 0 to 255 .
      Keyword :- In C programming 32 Keyword predefine . Ex. – int ,   flot , chan , for , while , switch, etc.  

 
UNIT
   1 BIT  =  (0’S, 1’S)
  1  BYTE  =   8  BIT
    1 KB  =  1024 BYTE
     1  MB  =1024 BYTE 
          1  GB  =   1024  MB   
                                        1  TB  =  1024 GB

IN C PROGRAMMING
           Int       - 2 Byte                                       Long  -  4 byte
          Float  -  4 byte                                       Double  -  8 byte
         Char   -  1 byte
 
NOTE : -  How to do C programming…??
  1). Do you make any program, you install  [ TURBO C ] software .   (C Programming karne ke liye apko TURBO C  name ka ek software apne system me install karna hoga.)
 2). We run (execute) any  C program . we have a three files. 
        FILE NAME                                    FILE
      a)   addition                                        .BAK   (backup file)
      b)   “          “                                      .OBJ   (object file)
      c)   “           “                                     .EXE    (executable file)

  3).  C programming is a case sensitive .
 
ASCII  : -  American standard code for information interchange .
                                A  =  65
                       a  =  97
Que : - How to initialize the value in variable..??
Ans  : - initialize value in compile time..

                    int a = 10;                                                a  [10]
               chan  ch = ‘A’                                         ch  [A]

Run time initialize : -
                      scanf( “Type specified”, & variable name);
                                             
Denoted by : -                   %d             =            int
                                                        %f              =            float
                                           %c              =           chan

Ex. : -        scanf(“%d”,&a);
                            scanf(“%f”,&b);
                   scanf(“%c”,&x);
                   scanf(“%d%f%c”,&a,&b,&x);

Output result : -     printf(“Welcome to C programming”);
·        Read the Save  result . (save kiya hua read karne ke liye)
Printf(“Type specified”,variable name);
Printf(“%d”, a);
                                To BE CONTINUED NEXT POST..

No comments:

Powered by Blogger.