Open Means Open Means

////////////////////////////////////////
#include

////////////////////////////////////////
// The main() function.
////////////////////////////////////////
int main()
{
     // Three uninitialized variables, different types.
     char myChar;
     short int myInt;
     long myLong;

     // An initialized variable of yet another type.
     float myFloat = 7e4;

     // Assign and convert.
     myChar = myInt = myLong = myFloat;

     // Display the variables.
     std::cout << myChar;
     std::cout << ' ';
     std::cout << myInt;
     std::cout << ' ';
     std::cout << myLong;
     std::cout << ' ';
     std::cout << myFloat;

     return 0;
}

No comments

Login to post a comment

Show
  • Create an account
  • Forgot your username?
  • Forgot your password?

Related Articles

  • Computer Q&A for K12 (+2) - Part IV
  • About Us
  • Faqs
  • Contact Us
  • Disclaimer
  • Terms & Conditions