MCS-011 Problem Solving and Programming

First year, Semester 1

Chapters

Newsletter

Initialising Variables

When variables are declared initial, values can be assigned to them in two ways:

  1. Within a Type declaration
    The value is assigned at the declaration time.
    For example,
    int a = 10;
    float b = 0.4 e –5;
    char c = ‘a’; 
  2. Using Assignment statement
    The values are assigned just after the declarations are made.
    For example,
    a = 10;
    b = 0.4 e –5;
    c = ‘a’;  

Report an issue

Reporting: Initialising Variables (topic)

Related Posts