Example of Variables Assignment Help

Assignment Help: >> Data Types, Variables and Operators in C++ - Example of Variables

Example

int value=250;

char name="Gaurav";

double amount=76.80;

Program to show declarations, assignments and initialization of various types of variables: -

# include <iostream.h>

void main(void)

{

/*.......Declarations....... */

float a, b;

double c, d;

unsigned u;

/*.......Initialization....... */

x = 19298;

int l = 9182769;

/* ....... Assignments.......*/

a= 2345.987;

b= 1928.283647;

d= c =2.20;

u= 54637;

/* .......Displaying.......*/ cout<<"x ="<<x; cout<<"l ="<<l;

cout<<"a ="<<a;

cout<<"d ="<<d;

cout<<"u ="<<"b ="<<"c =\n"<<u<<b<<c;

}

The output will be:

: x = 19298      l = 9182769 a= 2345.987000 d= 1928.283647000000 u= 54637 b=

2.200000 c = 2.200000000000

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd