cpp10 CPP - Bitwise logical operation CPP - Bitwise logical operation // Bitwise logical operation in binary, octal, decimal, hexadecimal. #include #include #include using namespace std; int main() { int iInput1, iInput2; double dInput1, dInput2; /* Octal -> Binary -> Hexadecimal 87 / 2 = 43 --1 43 / 2 = 21 --1 21 / 2 = 10 --1 10 / 2 = 5 --0 5 / 2 = 2 --1 2 / 2 = 1 --0 64 +0 +16 +0 +4 +2 +1 = 87 (decimal) 1 0 1 0 1 1 1 4 +0 +1 | 0 +.. 2019. 4. 3. CPP - Operator CPP - Operator // What is there a operator #include #include using namespace std; int main() { int iInput1, iInput2; double dInput1, dInput2; // 사칙연산 // +,-,*,ㅗ,% // 연산의 우선순위는 () */ +- 관계연산 논리연산 대입연산(=) // 두개의 실수를 입력을 받아서 사칙연산을 실행해보자 cout dInput1 >> iInput1 >> iInput2; cout 2019. 4. 3. CPP - DataType CPP - DataType // Datatype of CPP #include #include #include #define CHAR_INPUT_MAX 11 using namespace std; int main() { int iInput; char cInput_arr[CHAR_INPUT_MAX]; string sInput; float fInput; double dInput; long double ldInput; bool bInput; int x = 10, y = 20; // int cout iInput; cout 2019. 4. 3. CPP - C++ 출력 자리수 가. 폭 지정, fill 지정 출력되는 데이터가 화면상에 차지하는 폭은 별다른 지정을 하지 않고 데이터 를 출력했을 때 데이터의 길이에 맞추어진다. cout 2014. 9. 25. 이전 1 2 다음