Exercise 1: Declaration and Initialization Of Data Types

This exercise will test you on data types and initialization of declared variables in C++

We'll cover the following

Problem Statement

  • Declare an integer type variable name intNumber and assign it a value of 30.
  • Declare a float type variable name floatNumber and assign it a value of 30.78.
  • Declare a double type variable name doubleNumber and assign it a value of 45.1234.
  • Declare a bool type variable name boolean and assign it a value of true.
  • Declare a char type variable name charName and assign it a value of u.
  • Lastly, print the values of all declared variables.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy