Monday 29 March 2021

BASIC C PROGRAMMING

 Introduction to c language:

C एक programming language है. C language को "डेनिस रिचर्ड " ने सन् 1972 में विकसित किया था।
  यह language एक ऊंचे स्तर (High level) की programming language है, जो स्रोत कोड (source code)को मशीन कोड (machine code) में अनुवाद करने के लिए कंपाइलर का उपयोग करता है।
c प्रोग्रामिंग लैंग्वेज फीचर्स को पहले की भाषा में basic combined programming language कहा जाता है!

Dennis Ritchie

Variable:

Variable memory location को दिया गया एक नाम है, उस memory location पर जिस पर हम single value store कर सकते है।
      

 Declaration of variable:
    Data type                variable-name

1.     Int                           a, x, y, z;
2.   Float                        b,r;
3.   Char                         c;
       
 Data type:
यह भी एक डाटा (data) की तरह होता है,जिसको प्रोग्राम(program) के अन्दर प्रयोग (use) kiya जाता है।
C language में कई पूर्वनिर्धारित (predefine) डाटा टाइप (data type) इस प्रकार है,
Int, Float, Char  आदि।

     Basic Data Type              Derived Data
                                                                     Type

1.    Integer type(int)                 Pointer
2.   Floating type(float)            Array
3.    Character type(char)        Structure-
                                                            -Union


Data type is depicted as follows:

  मूल डेटा प्रकार हैं-

 (1) Integer data type(पूर्णांक डेटा प्रकार)

 (ii) Character data type(चरित्र डेटा प्रकार)

(iii) Floating data type(फ़्लोटिंग डेटा प्रकार)


 1. पूर्णांक डाटा प्रकार (int)- पूर्णांक वे संख्याएँ होती हैं जिनके या तो ऋणात्मक या धनात्मक मान हो सकते हैं लेकिन उनमें मान नहीं हो सकते हैं दशमलव। पूर्णांक प्रकार के मानों के लिए हम (int) कीवर्ड का उपयोग करते हैं।  

उदाहरण के लिए- int pen;  यहां, कलम pen एक variableहै जो integer typeके values को store कर सकता है। userद्वारा आवश्यकतानुसार एक प्रोग्राम में integer type के variable हो सकते हैं

उदाहरण के लिए- int pen, car, man;  

यहां, (pen, car, man) सभी integer type के value को store कर सकते हैं।  

Integer type variable का आकार या तो 2 bytes (पुराने पीसी के लिए) या 4 bytes (नए पीसी के लिए) है।


  2. चरित्र डाटा प्रकार (char) - character 'char' keywork का उपयोग करके घोषित(declare) किए जाते हैं।

उदाहरण के लिए- char pen= 'A';

 यहां, pen एक कैरेक्टर वैरिएबल(character variable)है जिसमें 'a' value है।

Character variable का आकार 1 byte है। 



3. फ्लोटिंग डाटा प्रकार (float) - "float'वह keyword है जिसका उपयोग दशमलव के साथ संख्याओं के मूल्यों को संग्रहीत(store) करने के लिए किया जाता है 

जैसे: 1.3, 5.66, -8.4। 

उदाहरण के लिए- float boy= 2.4;

यहां, लड़का एक variable है इसमें एक floating value 2.4 है। 

'double' का इस्तेमाल 'float' के स्थान पर भी किया जा सकता है। 'double' 'फ्लोट' की तुलना में 2 गुना अधिक सटीकता प्रदान करता है। Keyword 'float' का आकार 4 bytes है, जबकि 'double' है। 8bytes.

उदाहरण के लिए- double boy = 2.4; 

C programming में एक घातीय संख्या(exponential number का प्रतिनिधित्व(represent) करने के लिए, हम उपयोग कर सकते हैं- 

उदाहरण के लिए, float boy = 5.2 x 10e34;


ENGLISH TRANSLATION:


Introduction to c language:

C is a programming language. C language was developed by "Dennis Richard" in 1972.


   This language is a high level programming language, which uses the compiler to translate source code into machine code.


 c Programming language features are called basic combined programming language in earlier language.

Dennis Ritchie


Variable:

 Variable memory location is a name given to the memory location on which we can store a single value.


Declaration of variable:

Data type                               Variable-Name

 1. Int                                      a, x, y, z;

 2. Float                                  b, r;

 3. Char                                  c;


Data type:

 It is also like a data, which is used in the   program.Many predefine data types in C language are as follows,

  Int, Float, Char etc. 


Basic data type                         Drived data type 

1.Integer type(int)                   Pointer

2.Floating type(float)              Array

3.character type(char)            Structure union                                                            

The data type is depicted as follows:

The basic data types are-

(1) Integer data type (integer data type)

(ii) Character data type

(iii) Floating data type


  1. Integer Data Type (int) - Integers are numbers that can have either negative or positive values ​​but cannot contain values ​​in decimal. For the values ​​of integer type we use the (int) keyword.

For example-int pen;

Here, pen pen is a variable that can store values ​​of integer type.

A program can have integer type variables as required by the user.

For example- int pen, car, man;

Here, (pen, car, man) can store the value of all integer types.

The size of the integer type variable is either 2 bytes (for old PCs) or 4 bytes (for new PCs).



 2. Character data type (char) - character is declared using 'char' keywork.

For example- char pen = 'A';

 Here, pen is a character variable with 'a' value.

The size of the character variable is 1 byte.



3. Floating data type (float) - "float 'is the keyword used to store the values ​​of numbers with decimals.

Such as: 1.3, 5.66, -8.4.

For example- float boy = 2.4;

Here, the boy is a variable with a floating value of 2.4.

 'double' can also be used in place of 'float'. 'double' provides 2 times more accuracy than 'float'. The keyword 'float' is 4 bytes in size, while 'double' is. 8bytes.

For example- double boy = 2.4;

To represent an exponential number in C programming, we can use-

For example, float boy = 5.2 x 10e34;   

9 comments:

OPERATOR IN C

  Operators : An operator is the symbol that specify the operation or activity to be perform. Example :                  C language is ve...