You are on page 1of 7

1.

DATA TYPES IN C
To store data the program must reserve space which is done using datatype. A datatype is a
keyword/predefined instruction used for allocating memory for data. A data type specifies the
type of data that a variable can store such as integer, floating, character etc. It used for declar -
ing/defining variables or functions of different types before to use in a program.

9. C के डाटा टाइप्स
डेटा को संग्रहीत करने के लिए प्रोग्राम को स्थान आरक्षित करना होगा जो डेटाटाइप का उपयोग करके किया जाता है।
डेटाटाइप एक कीवर्ड /पूर्वनिर्धारित निर्देश है जिसका उपयोग डेटा के लिए मेमोरी आवंटित करने के लिए किया जाता है। एक
डेटा प्रकार उस डेटा के प्रकार को निर्दिष्ट करता है जिसे एक चर संग्रहीत कर सकता है जैसे पूर्णांक, फ्लोटिंग, वर्ण आदि। यह
एक प्रोग्राम में उपयोग करने से पहले विभिन्न प्रकार के चर या कार्यों को घोषित करने / परिभाषित करने के लिए उपयोग किया
जाता है।
Data Type Format Minimal Range Size Size
Specifier in in
bit bytes
unsigned char %c 0 to 255 8 1
char %c -127 to 127 8 1
signed char %c -127 to 127 8 1
int %d, %i -32,767 to 32,767 16 2
unsigned int %u 0 to 65,535 16 2
signed int %d, %i -32,767 to 32,767 (same as int) 16 2
short int %hd -32,767 to 32,767 16 2
unsigned short int %hu 0 to 65,535 16 2
signed short int %hd Same as short int 16 2
long int %ld, %li -2,147,483,647 to 2,147,483,647 32 4
long long int %lld, %lli -(2^63) to (2^63)-1 64 8
signed long int %ld, %li Same as long int 32 4
unsigned long int %lu 0 to 4,294,967,295 32 4
unsigned long long int %llu 0 to 18,446,744,073,709,551,615 64 8
float %f 1.2E-38 to 3.4E+38 32 4
double %lf 1.7E-308 to 1.7E+308 64 8
long double %Lf 3.4E-4932 to 1.1E+4932 16

Program to declare variables and print their values:

#include<stdio.h>
#include<conio .h>
void main()
2. RECEIVING INPUT FROM THE USER
In order to take input from the user and assign it to a variable, we use scanf function.
Syntax for using scanf:
Scanf (“%d”, &i); (& is important!)
& is the “address of” operator and it means that the supplied value should be copied to the
address which is indicated by variable i.
10. उपयोगकर्ता से इनपुट प्राप्त करना
उपयोगकर्ता से इनपुट लेने और इसे एक चर को असाइन करने के लिए, हम स्कै नफ फ़ं क्शन का उपयोग करते हैं। scanf का उपयोग
करने के लिए सिंटैक्स:
Scanf (“%d”, &i); (&महत्वपूर्ण है!)
& “ऑपरेटर का पता है” और इसका मतलब है कि आपूर्ति किए गए मूल्य को उस पते पर कॉपी किया जाना चाहिए जो चर i द्वारा
इंगित किया गया है।
// program for taking multiple values from
user
#include<stdio>
void main()
{
int x,y;
clrscr();
printf("Enter the numbers:");
scanf("%d%d", &x,&y);
printf("x is %d", x);
printf("y is %d", x);
getch();
}

11.एस्के प सीक्वेंस इन C
C भाषा में एक एस्के प अनुक्रम वर्णों का एक अनुक्रम है जो स्ट्रिंग शाब्दिक या चरित्र के अंदर उपयोग किए जाने पर स्वयं का
प्रतिनिधित्व नहीं करता है। यह बैकस्लैश से शुरू होने वाले दो या दो से अधिक वर्णों से बना है।
C में एस्के प अनुक्रमों की सूची:
11.OPERATORS IN C
12. C OPERATOR PRECEDENCE AND ASSOCIATIVITY
C operators in order of precedence (highest to lowest). Their associativity indicates in
what order operators of equal precedence in an expression are applied.
Operator Description Associativity
() Parentheses (function call) (see Note 1) left-to-right
[] Brackets (array subscript)
. Member selection via object name
-> Member selection via pointer
++ -- Postfix increment/decrement (see Note 2)
++ -- Prefix increment/decrement right-to-left
+- Unary plus/minus
!~ Logical negation/bitwise complement
(type) Cast (convert value to temporary value of
* type)
& Dereference
sizeof Address (of operand)
Determine size in bytes on this
implementation
*/% Multiplication/division/modulus left-to-right
+- Addition/subtraction left-to-right
<< >> Bitwise shift left, Bitwise shift right left-to-right
< <= Relational less than/less than or equal to left-to-right
> >= Relational greater than/greater than or
equal to
== != Relational is equal to/is not equal to left-to-right

You might also like