If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
Programming में Data Type बहुत ही important concept है। क्योंकि Data Type के according ही हम variable define करते हैं और उनके लिए logic implement करते हैं।
पिछले topic में आपने Variables के बारे में पढ़ा और समझा , आपको याद होगा कि कोई भी variable define करने से पहले हमें उसका type define करते थे जिससे पता लगाया जा सके कि वो variable किस type की value hold करेगा। इस topic में आप उन्ही सब types के बारे में पढ़ेंगे।
Data Type का simply मतलब है किसी variable का type, जिससे हमें पता चल सके कि कोई variable किस type की value hold किये हुए है , या in future किस type की value hold करेगा।
C language में Generally use होने वाले data types इस प्रकार हैं-
Type | Keyword | Size | Description |
---|---|---|---|
Integer | int | 2 or 4 bytes | यह बिना decimal points वाले whole numbers (पूर्ण संख्या) को store करता है। |
Character | char | 1 byte | यह single character store करता है। |
Floating point | float | 4 bytes | यह fractional numbers को point के बाद 7 digits तक store करता है। |
Double floating point | double | 8 bytes | यह भी fractional numbers को point के बाद 15 digits तक store करता है। |
इन basic types के variables को handle करने के लिए कुछ basic format specifiers भी हैं -
Data Type | Format Specifier |
---|---|
int | %d or %i |
char | %c |
float | %f |
double | %lf |
#include <stdio.h>
int main() {
int int_var = 90;
float float_var = 15.99;
double double_var = 15.99;
char char_var = 'R';
printf("int variable : %d", int_var);
printf("\nfloat variable : %d", float_var);
printf("\ndouble variable : %f", double_var);
printf("\nchar variable : %c", char_var);
return 0;
}
int variable : 90 float variable : 1519845401 double variable : 15.990000 char variable : R
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook