Exercise: Declaration and Initialization Of Data Types
Write a code that initializes the variables and displays them.
We'll cover the following...
We'll cover the following...
Problem statement
Declare variables, assign them specific values, and print each variable to the console. Write code that initializes the variables and displays them.
Sample input
Declare an
integertype variable namedintNumberand assign it a value of30.Declare a
floattype variable namedfloatNumberand assign it a value of30.78.Declare a
doubletype variable nameddoubleNumberand assign it a value of45.1234.Declare a
booltype variable namedbooleanand assign it a value oftrue.Declare a
chartype variable namedcharNameand assign it a value ofu.Lastly, print the values of all declared variables.
Sample output
At the end, your program should be able to display the following output: