C++ Variable Stores a few values in three variables, then prints the results:

Description

C++ Variable Stores a few values in three variables, then prints the results:

#include <iostream>
using namespace std;
int main()/* ww w .  j a v  a2 s .  c  om*/
{
   char first = 'E';     // Store some character, integer,
   char middle = 'W';     // and floating-point variable.
   char last = 'C';
   int age = 32;
   int dependents = 2;
   float salary = 25000.00;
   float bonus = 1.25;
   // Prints the results.
   cout << first << middle << last;
   cout << age << dependents;
   cout << salary << bonus;
   return 0;
}



PreviousNext

Related