C Variables





C Variables :

  • Variables are named locations in memory that are used to hold a value that may be modified by the program.

  • Unlike constants that remain unchanged during the execution of a program, A variable may take different values at different times during execution.

Syntax for variable declaration :

DataType   IdentifierName;
Example : int   num;
                     long int sum, a;

Declaring,   Initializing,   and Assigning Variables:

int  number; //this is called declaration
We can also declare and assign some content to a variable at the same time, is called initialization.
int  number = 20; //this is called initialization
After declaring variables, you can assign a value to a variable later on using a statement like this:
num = 30; //this is called assignment
We can also assign a variable the value of another variable, like so:
num = num1;

Example :

#include<stdio.h>  
int main()  //main function
{
    int x, y;     //declaration
    int z = 90;  //initialization
        x = z;  //assignment
    printf("Hello World!!\n");   
    return 0;
} 

Next topic is constants






 

Training For College Campus

We offers college campus training for all streams like CS, IT, ECE, Mechanical, Civil etc. on different technologies like
C, C++, Data Structure, Core Java, Advance Java, Struts Framework, Hibernate, Python, Android, Big-Data, Ebedded & Robotics etc.

Please mail your requirement at info@prowessapps.in


Projects For Students

Students can contact us for their projects on different technologies Core Java, Advance Java, Android etc.

Students can mail requirement at info@prowessapps.in



CONTACT DETAILS

info@prowessapps.in
(8AM to 10PM):

+91-9026070669 , +91-9451396824

© 2016, prowessapps.in, All rights reserved