fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4. using namespace std;
  5. int main(){
  6.  
  7. string z= "Hello world";//Literally what's in quotes
  8. bool j= true; //True or false -- 0, 1, true, false
  9. char k= 'a'; // Holds a single character
  10.  
  11. //i -- iterator.
  12.  
  13.  
  14. if (j==true) {
  15. if(k=='a'){
  16. cout<< z;
  17. }
  18. }
  19. else {
  20. cout << "Whoops, false";
  21. }
  22.  
  23. int m = 1; // Interger number, whole number. -32,768 - 32,767
  24. long n =123534241;//Used to store numbers bigger than an int
  25. float o = 1233.12344; // Floating point number
  26. double p = 123532523.123123; //is a float, with double the storage space
  27.  
  28. cout << setiosflags(ios::fixed) <<setiosflags(ios::showpoint) <<setprecision(2);
  29.  
  30. cout << p;
  31.  
  32. return 0;
  33. }
  34.  
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:23: warning: unused variable ‘m’
prog.cpp:24: warning: unused variable ‘n’
prog.cpp:25: warning: unused variable ‘o’
stdout
Hello world123532523.12