Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lesson 3

  • Loading branch information...
commit 7aeba855e1fafe00e298866a86bbdbb6326628cf 1 parent 18b6dcc
@VisViva authored
Showing with 33 additions and 0 deletions.
  1. +33 −0 Lesson_3
View
33 Lesson_3
@@ -0,0 +1,33 @@
+#include <iostream>
+
+int main()
+{
+ std::cout<<"Please input number.\n";
+
+ unsigned short sValueInput, sValueTemp;
+
+ std::cout << "sValue = ";
+ std::cin >> sValueInput;
+
+ sValueTemp = sValueInput;
+
+ sValueTemp <<= 1;
+ std::cout<<"sValue * 2 = "<< sValueTemp <<"\n";
+
+ sValueTemp = sValueInput;
+
+ sValueTemp = sValueTemp + (sValueTemp << 1);
+ std::cout<<"sValue * 3 = "<< sValueTemp <<"\n";
+
+ sValueTemp = sValueInput;
+
+ sValueTemp = sValueTemp << 2;
+ std::cout<<"sValue * 4 = "<< sValueTemp <<"\n";
+
+ sValueTemp = sValueInput;
+
+ sValueTemp = sValueTemp + (sValueTemp << 2);
+ std::cout<<"sValue * 5 = "<< sValueTemp <<"\n";
+
+ return 0;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.