TAILIEUCHUNG - Operators and Programming Constructs

Operators are used to compute results and compare the data values of a program. A program often involves decision-making and iterative tasks. To accomplish these tasks, programmers use various operators in the conditional and looping constructs. This chapter discusses the types of operators used in C# language. In addition, the conditional constructs and the looping constructs are also discussed. | Operators and Programming Constructs Operators are used to compute results and compare the data values of a program. A program often involves decision-making and iterative tasks. To accomplish these tasks programmers use various operators in the conditional and looping constructs. This chapter discusses the types of operators used in C language. In addition the conditional constructs and the looping constructs are also discussed. Chapter 3 Objectives In this chapter you will learn to fl Use various operators Arithmetic Arithmetic assignment Unary Comparison Logical fl Use conditional constructs fl Use looping constructs Using Operators Applications use operators to process the data entered by a user. Operators like and - are used to process variables and return a value. An operator is a set of one or more characters that is used for computations or comparisons. Operators can transform one or more data values called operands into a new data value. Consider the following expression X Y The preceding expression uses two operands and an operator to add the values stored in the variables. Operators in C can be classified as follows Arithmetic operators Arithmetic assignment operators Unary operators Comparison operators Logical operators Arithmetic Operators These operators are the symbols that are used to perform arithmetic operations on variables. The following table describes the commonly used arithmetic operators. Operator Description Example Used to add two numbers X Y Z If Y is equal to 20 and Z is equal to 2 X will have the value 22. - Used to subtract two numbers X Y-Z If Y is equal to 20 and Z is equal to 2 X will have the value 18. Used to multiply two numbers X Y Z If Y is equal to 20 and Z is equal to 2 X will have the value 40. NIIT Operators and Programming Constructs .

TÀI LIỆU MỚI ĐĂNG
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.