ភាសាកម្មវិធី C++៖ ថេរ
ថេរ Constants នៅពេលដែលអ្នកមិនចង់អោយអ្នកដទៃ (ឬខ្លួនអ្នកផ្ទាល់) បដិសេធ (override) តម្លៃអថេរដែលមានស្រាប់សូមប្រើពាក្យគន្លឹះ const [នេះនឹងប្រកាសអថេរជា "ថេរ" ដែលមានន័យថាមិនអាចផ្លាស់ប្តូរបាននិងអាចអានបាន(unchangeable and read-only)]៖ ឧទាហរណ៍៖ ជានិច្ចកាលអ្នកគួរតែប្រកាសអថេរ (variable) ជាថេរ (constant)នៅពេលអ្នកមាន តម្លៃណាមួយដែលមិនទំនងជាផ្លាស់ប្តូរ៖ ឧទាហរណ៍៖



Submitted
ReplyDeleteExercise 1
ReplyDeleteInsert the missing part of the code below to display "Hello World!":
cout<<"Hello world!";
return 0;
}
Exercise 2
By using a special character, insert a new line after "Hello World":
cout << "Hello World! \n";
cout << "I am learning C++";
return 0;
}
Exercise 3 Insert the missing parts, Comments in C++ are written with special characters. Insert the missing parts:
/ This is a single-l i ne comment
/This is a muti-l i ne comment *
Ex3: It should be /*This is a single-l i ne comment
Delete*This is a muti-l i ne comment*/
Thanks!!!