programminghead Logo

Variables in C Language

Variables :

in C Language Variables is like a Placeholder for a value. Variables works as a Name in C language to store or Hold Value in the refereed location in the Memory. So there is Tones of works Done by Variables Like Holding A Value, Accessing the saved Values, Location Etc, here Data Types Plays A Very Impotent Role In the Value Storage,Value Handing Process.

Data Types in C Language/Programming

Data Type :

Each variables in C has an associated data type which save data for our variables, Also each Data Type required different amount of Memory and has storing Range limits.
Here are some

Examples of C Data Types :

int :

int is a Data Type of C for storing Integer (int) Values Like 1,2,3,4 etc.
Memory 4 Bytes
Range -2,147,483,648 to 2,147,483,647

char :

char is also a Data Type of C for storing Character (char) Values Like a,b,c,d etc.
Memory 1 Bytes
Signed Char Range -128 to 127
Unsigned Char Range 0 to 255

float :

This Data Type of C is used to store decimal numbers (numbers with floating point value) with single precision.
Memory 4 Bytes

double :

This Data Type of C is used to store decimal numbers (numbers with floating point value) with double precision Like 1.1, 1.2, 1.3, 1.4 Etc.
Memory of Double 8 Bytes
Memory of Long Double 8 Bytes.

Use Of %d,%c,%f And %lf

%d,%c,%f And %lf, All are Format Specifiers in C Language.They Used in C Language to tell Compiler To treat Values According To Format Specifier They Specifies Place to Get/Store Data or Display Data.
Like,in this Example we are going to use these Formate Specifiers to print data to Output Screen.

%d Format Specifier :

The %d Format Specifier are used to GetAnd Output The Integer Values Like : 1,2,3,4 ETC.

%c Format Specifier :

The %d Format Specifier are used to GetAnd Output The Character Values Like : a,b,c,d,e ETC.

%lf Format Specifier :

The %d Format Specifier are used to GetAnd Output The Float Values with Decimal Point Like : 1.1,1.2,1.3,1.4 ETC.

C Data Type Example

void main()

     int a=1;
     char b='z';
     float c=3.5;
     char d[15]="programminghead";
     printf("a =%d",a);
     printf("\nb =%c",b);
     printf("\nc =%f",c);
     printf("\nd =%s",d);



a =1
b =z
c =3.500000
d =programminghead

Example (Explained):

#include<stdio.h> :

#include<stdio.h> is a Header file that includes Slandered (str) Input Output (IO) Library/File. Because All Of the C's In build Functions are declared in <stdio.h> File

main() :

main() (main function) is the entry point of C program. When We Run our C program the execution Control Directly to the main() (main function) and gave us result in output.

printf() :

printf() is also a Function of C. Printf() is used to print “character, string, float, integer,etc” to the output screen.
So what ever we write between printf() inverted commas (" ") that will be printed on the output Screen


download minecraft
12:22 am

all the time i used to read smaller posts that as well clear their motive, and that is also happening with this post which I am reading at this time.

download minecraft free
07:04 am

It's impressive that you are getting thoughts from this article as well as from our discussion made here.

how to download minecraft free
11:46 am

Thanks , I have just been searching for information approximately this topic for a while and yours is the greatest I've came upon so far. But, what about the conclusion? Are you sure in regards to the source?

03:12 am

These are really enormous ideas in concerning blogging. You have touched some fastidious things here. Any way keep up wrinting.

10:14 pm

Wonderful site you have here but I was curious if you knew of any forums that cover the same topics discussed in this article? I'd really love to be a part of online community where I can get feedback from other knowledgeable individuals that share the same interest. If you have any suggestions, please let me know. Thanks!

06:41 pm

Hi i am kavin, its my first time to commenting anywhere, when i read this post i thought i could also create comment due to this sensible paragraph.

06:36 am

Thanks a bunch for sharing this with all people you really understand what you're talking about! Bookmarked. Kindly additionally visit my website =). We can have a link exchange contract among us

12:21 am

What's Taking place i am new to this, I stumbled upon this I've discovered It positively helpful and it has helped me out loads. I'm hoping to contribute & help other users like its aided me. Good job.

how to download minecraft free
09:40 am

Excellent blog you have here.. It's hard to find quality writing like yours nowadays. I seriously appreciate people like you! Take care!!

minecraft free
11:34 am

Having read this I thought it was rather enlightening. I appreciate you taking the time and energy to put this short article together. I once again find myself spending a lot of time both reading and posting comments. But so what, it was still worth it!

how to download minecraft free
01:19 pm

Hi, Neat post. There's a problem along with your site in internet explorer, would check this? IE nonetheless is the market leader and a huge section of other folks will pass over your fantastic writing because of this problem.

minecraft for free
02:50 pm

Hi to every , since I am truly eager of reading this web site's post to be updated daily. It carries fastidious stuff.

05:00 pm

Hi there! I'm at work surfing around your blog from my new iphone 3gs! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the great work!

11:32 pm

This article provides clear idea in support of the new people of blogging, that actually how to do blogging.

gamefly free trial
10:20 am

I could not refrain from commenting. Exceptionally well written!

gamefly free trial
07:17 pm

Nice post. I was checking constantly this weblog and I am impressed! Very useful information specifically the ultimate section : ) I maintain such info much. I used to be seeking this particular info for a very lengthy time. Thanks and good luck.

Write to Us