The document discusses various types of operators in the C programming language. It describes operators as symbols that are used to perform logical and mathematical operations on variables and constants to form expressions. The main types of operators covered are arithmetic, assignment, relational, logical, bitwise, conditional/ternary, and increment/decrement operators. Examples are provided to demonstrate the use of each operator type.
The document discusses various operators in the C programming language. It begins by defining C operators as symbols that are used to perform logical and mathematical operations. It then describes the different types of operators in C - arithmetic, assignment, relational, logical, bitwise, conditional (ternary), and increment/decrement operators. For each type of operator, it provides examples and an example program to demonstrate their usage.
The document discusses various operators in the C programming language. It describes arithmetic, assignment, relational, logical, conditional, and type casting operators. It provides examples to demonstrate how each operator works. It also covers decision control structures like if, if-else, nested if, and switch statements that allow conditional execution of code in C based on different conditions.
1. Operators take operands and perform computations. Common operators include arithmetic, relational, logical, and assignment.
2. Operands are variables or expressions used with operators. Expressions combine operands and operators to evaluate to a value.
3. Statements specify actions and are usually executed sequentially. Expressions can be used in statements.
Mesics lecture 4 c operators and experssionseShikshak
Operators in C allow operations to be performed on operands. Common operators include arithmetic, relational, logical, and bitwise operators. Operators have precedence and associativity that determine the order of operations. The conditional operator (?:) evaluates a condition and returns one of two expressions. Operators are used to perform calculations, comparisons, assignments, and logical tests in C programs.
There are several types of operators used in C programming including arithmetic, assignment, equality/relational, logical, and conditional operators. Arithmetic operators are used for mathematical operations and include binary operators like addition and subtraction that require two operands as well as unary operators like increment/decrement that require one operand. Assignment operators combine the assignment operator (=) with a binary arithmetic operator. Equality/relational operators compare values, logical operators combine conditions, and conditional operators provide if/else functionality in a single statement. Operator precedence determines the order of operations when multiple operators are used in a single statement.
This document discusses arithmetic, logical, and relational operations and expressions in C++. It covers basic arithmetic operations like addition, subtraction, multiplication, and division. It also discusses arithmetic expressions, precedence rules, assignment statements, initializing variables, relational operations, logical operations, unary operators, and good programming style practices like indenting, comments, and using constants.
The document discusses various elements of programming in C++ including literals, variables, types, expressions, statements, control flow constructs, functions, and libraries. It then focuses on different types of operators in C++ like arithmetic, relational, logical, and bitwise operators. It explains operator precedence and associativity rules for evaluating expressions. Special assignment operators, increment/decrement operators, and their differences are also covered.
The document discusses various operators in the C programming language. It begins by defining C operators as symbols that are used to perform logical and mathematical operations. It then describes the different types of operators in C - arithmetic, assignment, relational, logical, bitwise, conditional (ternary), and increment/decrement operators. For each type of operator, it provides examples and an example program to demonstrate their usage.
The document discusses various operators in the C programming language. It describes arithmetic, assignment, relational, logical, conditional, and type casting operators. It provides examples to demonstrate how each operator works. It also covers decision control structures like if, if-else, nested if, and switch statements that allow conditional execution of code in C based on different conditions.
1. Operators take operands and perform computations. Common operators include arithmetic, relational, logical, and assignment.
2. Operands are variables or expressions used with operators. Expressions combine operands and operators to evaluate to a value.
3. Statements specify actions and are usually executed sequentially. Expressions can be used in statements.
Mesics lecture 4 c operators and experssionseShikshak
Operators in C allow operations to be performed on operands. Common operators include arithmetic, relational, logical, and bitwise operators. Operators have precedence and associativity that determine the order of operations. The conditional operator (?:) evaluates a condition and returns one of two expressions. Operators are used to perform calculations, comparisons, assignments, and logical tests in C programs.
There are several types of operators used in C programming including arithmetic, assignment, equality/relational, logical, and conditional operators. Arithmetic operators are used for mathematical operations and include binary operators like addition and subtraction that require two operands as well as unary operators like increment/decrement that require one operand. Assignment operators combine the assignment operator (=) with a binary arithmetic operator. Equality/relational operators compare values, logical operators combine conditions, and conditional operators provide if/else functionality in a single statement. Operator precedence determines the order of operations when multiple operators are used in a single statement.
This document discusses arithmetic, logical, and relational operations and expressions in C++. It covers basic arithmetic operations like addition, subtraction, multiplication, and division. It also discusses arithmetic expressions, precedence rules, assignment statements, initializing variables, relational operations, logical operations, unary operators, and good programming style practices like indenting, comments, and using constants.
The document discusses various elements of programming in C++ including literals, variables, types, expressions, statements, control flow constructs, functions, and libraries. It then focuses on different types of operators in C++ like arithmetic, relational, logical, and bitwise operators. It explains operator precedence and associativity rules for evaluating expressions. Special assignment operators, increment/decrement operators, and their differences are also covered.
This document discusses different types of operators in C programming language. It describes arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise and special operators. For each type of operator, it provides the syntax, examples of use, and meaning or purpose. The key types of operators covered are arithmetic (for math operations), relational (for comparisons), logical (for conditional logic), and assignment (for assigning values). Examples are provided to demonstrate how each operator is used in C code.
C operators allow building expressions and making decisions in code. The document discusses several categories of operators in C including arithmetic, assignment, relational, logical, bitwise, and others. It provides examples of using each type of operator and explains precedence rules and associativity. Key points covered include: how each operator works; common uses like conditional checks, assignments, and bit manipulation; and important considerations like order of operations and integer division behavior.
Get more from www.programmingcampus.com
Operators in c programming
-definition of operator
-types of operators
1.Arithmetic operators.
2. Relational operators.
3. Logical operators.
4. Assignment operators.
5. Increment & decrement operators.
a. pre and post increment operator
b. pre and post increment operator
6. Conditional operators.
7. Bitwise operators.
8. Special operators
This chapter discusses different operators in C including arithmetic, assignment, equality/relational, logical, and conditional operators. It explains unary and binary arithmetic operators, the difference between pre- and post-increment operators, and precedence rules for evaluating expressions with multiple operators. Logical operators allow testing of multiple conditions and the conditional operator provides a simplified if/else statement syntax.
C++ supports various types of operators including unary, arithmetic, relational, logical, bitwise, and assignment operators. Unary operators operate on a single operand, while binary operators operate on two operands. Expressions in C++ combine operands and operators, and can be arithmetic expressions using operators like + and -, or relational expressions using comparison operators like > and ==.
This presentation contain description about C Operators.
It explains Arithmetic operators, relational operators, logical operators, increment/decrement operators, conditional and bitwise operators are explained with example.
This document discusses different types of operators in C programming language including mathematical, relational, logical, assignment, unary, increment/decrement, bitwise, ternary, and grouping operators. It provides examples of common operators like +, -, *, /, >, <, ==, !, &&, ||, +=, *, size of, <<, >>, &, |, ~, and lists their operations and usages.
Operators are symbols that perform specific tasks like mathematical or logical operations on operands or values. There are several types of operators in C/C++ including arithmetic, relational, logical, bitwise, assignment, conditional, and special operators. Arithmetic operators perform math operations like addition, subtraction, multiplication, and division. Relational operators check relationships between operands like equality, greater than, less than. Logical operators perform logical AND, OR, and NOT operations.
This document discusses various types of operators in C programming. It describes arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and special operators. Examples are provided for each type of operator to demonstrate their usage. The key types of operators covered are arithmetic (e.g. +, -, *, /), relational (e.g. <, >, ==), logical (e.g. &&, ||), assignment (=), increment/decrement (++, --), and conditional/ternary (?:) operators. Special operators like sizeof and comma operators are also briefly explained.
The document discusses operators in the C programming language. It defines different types of operators such as arithmetic, relational, logical, and assignment operators. It provides examples of using various operators like addition, subtraction, multiplication, division, modulus, increment, decrement, relational, and logical operators. It also covers operator precedence and associativity rules for evaluating expressions containing multiple operators.
Operators in C include assignment, arithmetic, relational, increment/decrement, logical, and special operators. Assignment operators assign values to variables, like a = 10. Arithmetic operators perform math operations like addition and multiplication. Relational operators compare values, such as greater than (>) or less than (<). Increment/decrement operators increase or decrease a variable by 1. Logical operators combine relations and reduce them to true or false.
At the end of this lecture students should be able to;
Define the terms operators, operands, operator precedence and associativity.
Describe operators in C programming language.
Practice the effect of different operators in C programming language.
Justify evaluation of expressions in programming.
Apply taught concepts for writing programs.
The document discusses C operators and expressions. It describes the different types of operators in C including arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and special operators. It also discusses arithmetic expressions and conditional expressions, providing examples of each. The key types of operators covered are arithmetic, relational, logical, assignment, and bitwise operators.
The document discusses various C operators including:
1) Arithmetic operators for addition, subtraction, multiplication, division, and modulus
2) Relational operators for comparisons like less than, greater than, equal to
3) Logical operators for AND, OR, and NOT operations
4) Assignment, increment, decrement, conditional, bitwise, and special operators and their uses. Examples are provided to demonstrate how each operator works.
Variables, Data Types, Operator & Expression in c in detailgourav kottawar
This document provides an overview of variables, data types, operators, and expressions in C programming. It covers C's character set and tokens. It describes the different data types like integer, floating point, character, and string. It also discusses variables, declarations, definitions, and user-defined types. The document outlines the various operators in C including arithmetic, relational, logical, increment/decrement, bitwise, assignment, and conditional operators. It explains type conversions, both implicit and explicit, in expressions. Finally, it covers operator precedence and associativity rules for evaluating expressions in C.
C OPERATORS
The operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C language is rich in built-in operators and provides the following types of operators:
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Assignment Operators
5. Increment and Decrement Operators
6. Conditional Operators
7. Bitwise Operators
8. Special Operators
C supports various types of operators that are used to manipulate data and variables. The main types of operators in C are arithmetic, relational, logical, assignment, increment/decrement, conditional, and bitwise operators. Each operator has a specific function like addition, subtraction, comparison, assignment, etc. Operator precedence and associativity determine the order in which expressions are evaluated when multiple operators are used.
The document discusses various operators and control structures in C programming language. It describes different types of operators like arithmetic, relational, logical, bitwise, assignment etc. and provides examples of their usage. It also explains control structures like if-else, nested if, else-if ladder and switch case statements that allow conditional execution of code in C. Various type conversions and precedence rules for operators are also covered in the document.
The document discusses various operators and control structures in C programming language. It covers arithmetic, relational, logical, bitwise and assignment operators. It also discusses unary, binary and ternary operators. Additionally, it discusses control structures like if, if-else, nested if, else-if ladder and switch statements used for decision making. Examples are provided for each operator and control structure to demonstrate their usage.
This document provides an overview of C++ data types, variables, and operators. It describes the fundamental data types in C++ including int, float, char, and boolean. It discusses how to declare variables, their scope, and initialization. The document also covers various operators in C++ like arithmetic, relational, logical, bitwise, and assignment operators. It provides examples of using these operators and their functionality. Finally, it briefly introduces arrays in C++ including declaration and initialization.
This document discusses different types of operators in C programming language. It describes arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise and special operators. For each type of operator, it provides the syntax, examples of use, and meaning or purpose. The key types of operators covered are arithmetic (for math operations), relational (for comparisons), logical (for conditional logic), and assignment (for assigning values). Examples are provided to demonstrate how each operator is used in C code.
C operators allow building expressions and making decisions in code. The document discusses several categories of operators in C including arithmetic, assignment, relational, logical, bitwise, and others. It provides examples of using each type of operator and explains precedence rules and associativity. Key points covered include: how each operator works; common uses like conditional checks, assignments, and bit manipulation; and important considerations like order of operations and integer division behavior.
Get more from www.programmingcampus.com
Operators in c programming
-definition of operator
-types of operators
1.Arithmetic operators.
2. Relational operators.
3. Logical operators.
4. Assignment operators.
5. Increment & decrement operators.
a. pre and post increment operator
b. pre and post increment operator
6. Conditional operators.
7. Bitwise operators.
8. Special operators
This chapter discusses different operators in C including arithmetic, assignment, equality/relational, logical, and conditional operators. It explains unary and binary arithmetic operators, the difference between pre- and post-increment operators, and precedence rules for evaluating expressions with multiple operators. Logical operators allow testing of multiple conditions and the conditional operator provides a simplified if/else statement syntax.
C++ supports various types of operators including unary, arithmetic, relational, logical, bitwise, and assignment operators. Unary operators operate on a single operand, while binary operators operate on two operands. Expressions in C++ combine operands and operators, and can be arithmetic expressions using operators like + and -, or relational expressions using comparison operators like > and ==.
This presentation contain description about C Operators.
It explains Arithmetic operators, relational operators, logical operators, increment/decrement operators, conditional and bitwise operators are explained with example.
This document discusses different types of operators in C programming language including mathematical, relational, logical, assignment, unary, increment/decrement, bitwise, ternary, and grouping operators. It provides examples of common operators like +, -, *, /, >, <, ==, !, &&, ||, +=, *, size of, <<, >>, &, |, ~, and lists their operations and usages.
Operators are symbols that perform specific tasks like mathematical or logical operations on operands or values. There are several types of operators in C/C++ including arithmetic, relational, logical, bitwise, assignment, conditional, and special operators. Arithmetic operators perform math operations like addition, subtraction, multiplication, and division. Relational operators check relationships between operands like equality, greater than, less than. Logical operators perform logical AND, OR, and NOT operations.
This document discusses various types of operators in C programming. It describes arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and special operators. Examples are provided for each type of operator to demonstrate their usage. The key types of operators covered are arithmetic (e.g. +, -, *, /), relational (e.g. <, >, ==), logical (e.g. &&, ||), assignment (=), increment/decrement (++, --), and conditional/ternary (?:) operators. Special operators like sizeof and comma operators are also briefly explained.
The document discusses operators in the C programming language. It defines different types of operators such as arithmetic, relational, logical, and assignment operators. It provides examples of using various operators like addition, subtraction, multiplication, division, modulus, increment, decrement, relational, and logical operators. It also covers operator precedence and associativity rules for evaluating expressions containing multiple operators.
Operators in C include assignment, arithmetic, relational, increment/decrement, logical, and special operators. Assignment operators assign values to variables, like a = 10. Arithmetic operators perform math operations like addition and multiplication. Relational operators compare values, such as greater than (>) or less than (<). Increment/decrement operators increase or decrease a variable by 1. Logical operators combine relations and reduce them to true or false.
At the end of this lecture students should be able to;
Define the terms operators, operands, operator precedence and associativity.
Describe operators in C programming language.
Practice the effect of different operators in C programming language.
Justify evaluation of expressions in programming.
Apply taught concepts for writing programs.
The document discusses C operators and expressions. It describes the different types of operators in C including arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and special operators. It also discusses arithmetic expressions and conditional expressions, providing examples of each. The key types of operators covered are arithmetic, relational, logical, assignment, and bitwise operators.
The document discusses various C operators including:
1) Arithmetic operators for addition, subtraction, multiplication, division, and modulus
2) Relational operators for comparisons like less than, greater than, equal to
3) Logical operators for AND, OR, and NOT operations
4) Assignment, increment, decrement, conditional, bitwise, and special operators and their uses. Examples are provided to demonstrate how each operator works.
Variables, Data Types, Operator & Expression in c in detailgourav kottawar
This document provides an overview of variables, data types, operators, and expressions in C programming. It covers C's character set and tokens. It describes the different data types like integer, floating point, character, and string. It also discusses variables, declarations, definitions, and user-defined types. The document outlines the various operators in C including arithmetic, relational, logical, increment/decrement, bitwise, assignment, and conditional operators. It explains type conversions, both implicit and explicit, in expressions. Finally, it covers operator precedence and associativity rules for evaluating expressions in C.
C OPERATORS
The operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C language is rich in built-in operators and provides the following types of operators:
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Assignment Operators
5. Increment and Decrement Operators
6. Conditional Operators
7. Bitwise Operators
8. Special Operators
C supports various types of operators that are used to manipulate data and variables. The main types of operators in C are arithmetic, relational, logical, assignment, increment/decrement, conditional, and bitwise operators. Each operator has a specific function like addition, subtraction, comparison, assignment, etc. Operator precedence and associativity determine the order in which expressions are evaluated when multiple operators are used.
The document discusses various operators and control structures in C programming language. It describes different types of operators like arithmetic, relational, logical, bitwise, assignment etc. and provides examples of their usage. It also explains control structures like if-else, nested if, else-if ladder and switch case statements that allow conditional execution of code in C. Various type conversions and precedence rules for operators are also covered in the document.
The document discusses various operators and control structures in C programming language. It covers arithmetic, relational, logical, bitwise and assignment operators. It also discusses unary, binary and ternary operators. Additionally, it discusses control structures like if, if-else, nested if, else-if ladder and switch statements used for decision making. Examples are provided for each operator and control structure to demonstrate their usage.
This document provides an overview of C++ data types, variables, and operators. It describes the fundamental data types in C++ including int, float, char, and boolean. It discusses how to declare variables, their scope, and initialization. The document also covers various operators in C++ like arithmetic, relational, logical, bitwise, and assignment operators. It provides examples of using these operators and their functionality. Finally, it briefly introduces arrays in C++ including declaration and initialization.
The document discusses various types of operators in Java including arithmetic, unary, assignment, relational, logical, ternary, bitwise, and shift operators. It provides examples to demonstrate the usage of each type of operator and the output. Key operator types covered are arithmetic (+, -, *, /, %), unary (++, --, !), assignment (=, +=, -=, etc.), relational (==, !=, <, >, etc.), logical (&&, ||) and examples are given for each.
The document discusses the different types of operators in C programming language including arithmetic, assignment, relational, logical, bitwise, conditional (ternary), and increment/decrement operators. It provides examples of how each operator is used in C code and what operation they perform on variables and values.
The document discusses various C operators including arithmetic, relational, logical, bitwise, assignment and increment/decrement operators. It provides examples and explanations of how each operator works. Key operator categories covered include arithmetic operators for mathematical operations, relational operators for comparisons, logical operators for logical expressions, bitwise operators for bit-level operations, and assignment operators for assigning values. Precedence rules and associativity of operators are also explained.
Operators are symbols that tell the computer to perform mathematical or logical manipulations on data. There are several types of operators in C including arithmetic, relational, logical, assignment, increment/decrement, conditional, and bitwise operators. Operators are used in expressions to manipulate variables and return a value. For example, arithmetic operators like +, -, *, / perform addition, subtraction, multiplication and division on operands.
The document summarizes the different types of operators in the C programming language. It describes arithmetic operators for mathematical calculations, assignment operators for assigning values to variables, relational operators for comparing values, logical operators for logical operations, bitwise operators for bit operations, conditional (ternary) operators for conditional expressions, and increment/decrement operators for increasing or decreasing variable values. Examples are provided for each type of operator to demonstrate their usage.
C provides various built-in operators to manipulate data and variables. These operators can be classified as arithmetic, relational, logical, bitwise, assignment, conditional, and special operators. Arithmetic operators perform basic math operations like addition and subtraction. Relational operators compare values. Logical operators combine conditional statements. Bitwise operators perform manipulations at the bit level. Assignment operators assign values. Conditional operators provide an if-else statement in a single line. Precedence and associativity determine the order of evaluation for expressions containing multiple operators.
The document discusses various operators in C programming language including arithmetic, logical, relational, increment/decrement, assignment, bitwise, equality and other operators. It provides examples of how each operator works along with code snippets demonstrating their usage. Key points covered include how arithmetic operators perform basic math operations, logical operators evaluate conditions, relational operators compare values, and bitwise operators perform operations on individual bits.
This document provides an overview of key concepts in C programming including data types, variables, constants, arithmetic expressions, assignment statements, and logical expressions. It discusses how integers, characters, and floating-point numbers are represented in C. It also explains the different types of constants and variables as well as the various arithmetic, assignment, and logical operators supported in C. Examples are provided to demonstrate the use of these operators.
Operators-computer programming and utilzationKaushal Patel
The document discusses various types of operators in the C programming language. It describes arithmetic operators like addition, subtraction, multiplication and division. It also covers assignment operators, logical operators, increment and decrement operators, bitwise operators, and other special operators. Examples are provided to demonstrate how each operator works, including their precedence order when used together in expressions. The key operators and their uses in C programming are summarized concisely.
C operators allow building expressions and performing operations in C programs. The main types of operators in C are arithmetic, assignment, logical/relational, bitwise, and others like sizeof. Arithmetic operators perform math operations like addition and subtraction. Assignment operators assign values. Logical operators allow conditional logic. Relational operators compare values. Bitwise operators work at the bit level. Precedence rules determine the order calculations are performed. Operators are used with operands and follow consistent rules in C.
This document discusses operators and expressions in C. It defines operands and operators, and describes the different types of operators in C including arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and comma operators. It explains the properties of operators such as precedence and associativity. Examples are provided to demonstrate how each operator works. The document also discusses the rules for evaluating expressions and provides additional examples.
Operators and expressions in c languagetanmaymodi4
what is operator in c language
uses of operator in c language
syatax of operator in c language
program of operator in c language
what is expressions in c language
use of expressions in c language
syantax of expressions in c language
Operators are symbols that are used to perform operations in C programs. There are different types of operators including arithmetic, relational, logical, bitwise, and assignment. Arithmetic operators are used for math operations like addition and multiplication. Relational operators compare values. Logical operators combine conditional statements. Assignment operators assign values to variables. Bitwise operators work at the bit level of data. Operator precedence and associativity determine the order of evaluation in expressions.
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of PrecedenceMuhammad Hammad Waseem
The document discusses arithmetic operators and order of precedence in C++. It defines the basic arithmetic operators (+, -, *, /, %) and their usage. It also explains the rules for integer and float conversions during arithmetic operations. Finally, it describes the order of precedence followed in C++, with multiplication and division having higher precedence than addition and subtraction, and operations in parentheses being evaluated first. Examples are provided to demonstrate how expressions are evaluated based on these rules.
This document describes a project to monitor and control the speed of an electric motor using a variable frequency drive (VFD) via wireless technology and the Internet of Things (IoT). A VFD controls the speed of a motor by varying the frequency and voltage of the input. Typically, VFDs are controlled on-site, but this project integrates the VFD with the internet using a Texas Instruments CC3200 microcontroller to allow remote monitoring and control of the motor speed via a mobile application. Real-time motor speed data can be monitored from remote locations and stored in the cloud for analysis. The goal is to provide a non-physical means of controlling and monitoring VFDs and motor speed wirelessly.
The document contains summaries of various Unix/Linux commands and programs executed by a student. It includes 15 examples covering topics like utility commands, system variables, administrative commands, displaying users, file permissions, deleting files, displaying code from a file, deleting lines containing a word, checking file/directory type, arithmetic/logical calculations, factorials, string operations, checking for vowels, and file operations. For each example, it lists the aim, program/commands used, outputs, and verifies the results.
The document provides an overview of various types of IoT applications across different domains including homes, cities, environment, energy systems, retail, logistics, industry, agriculture and health. It describes common IoT applications for each domain such as smart lighting, appliances and security for homes, smart parking, lighting and roads for cities, weather monitoring and pollution detection for environment, smart grids and renewable energy monitoring for energy, inventory management and smart payments for retail.
This document discusses Internet of Things (IoT) system management using NETCONF-YANG. It begins with an introduction to IoT and Machine-to-Machine (M2M) technology, then discusses the need for IoT system management. It describes network management protocols like SNMP and their limitations. The document introduces NETCONF and YANG as alternatives for managing IoT systems and outlines network operator requirements for IoT management.
The document discusses artificial intelligence (AI) and summarizes key points in 3 sentences:
AI is defined as making computers do things that people currently do better. Research in AI spans a broad range of problems from perception and natural language to games, mathematics, and expert tasks. Effective AI techniques exploit organized knowledge that can be easily modified and used flexibly to reduce its own volume.
The document discusses artificial intelligence (AI) and provides definitions, techniques, branches, and applications of AI. It defines AI as creating intelligent machines, especially computer programs, that can think like humans. It discusses representing knowledge to solve problems as an AI technique. Some branches of AI mentioned are logical AI, search, pattern recognition, representation, inference, common sense reasoning, learning from experience, planning, and applications in fields like robotics, natural language processing, and game playing.
The document discusses various domain-specific Internet of Things (IoT) applications. It describes how IoT is used in domains including homes, cities, the environment, energy systems, retail, logistics, industry, agriculture, and healthcare. It provides examples of IoT applications for home automation including smart lighting, smart appliances, intrusion detection, and smoke/gas detectors. It also discusses IoT applications for cities such as smart parking, smart lighting, smart roads, structural health monitoring, surveillance, and emergency response.
The document discusses various domain specific Internet of Things (IoT) applications. It provides an overview of IoT applications for homes, cities, environment, energy systems, retail, logistics, industry, agriculture and health. For each domain, examples of IoT applications are described, including smart lighting, appliances and security for homes, smart parking, lighting and infrastructure monitoring for cities, weather monitoring and pollution detection for environment, and so on.
This document contains 25 multiple choice questions about various heuristic search techniques and algorithms including breadth-first search, depth-first search, hill climbing, A*, and AND-OR graphs. It asks about the characteristics, applications, advantages, and limitations of these techniques. Some key algorithms and concepts covered are hill climbing getting stuck in local maxima, A* being guaranteed to find an optimal solution if one exists, AND-OR graphs being decomposed into smaller subproblems, and agendas being useful for implementing non-monotonic production systems.
This document contains 20 multiple choice questions about artificial intelligence concepts like state-space search, heuristic functions, breadth-first search, depth-first search, and heuristic search. State-space search involves exploring all possible states that can be reached. Heuristic functions aim to estimate how close a state is to the goal state. Breadth-first search explores all neighboring nodes before moving to nodes farther away, while depth-first search proceeds as far as possible along each branch before backtracking. Heuristic search uses heuristics to guide the search toward more promising areas.
The document discusses various domain-specific Internet of Things (IoT) applications. It describes IoT applications in several domains including homes, cities, environment, energy systems, retail, logistics, industry, agriculture, and healthcare. For each domain, it provides examples of IoT applications and describes how sensors and cloud-based systems are used to collect and analyze data to enable various functions.
The document discusses the introduction to Internet of Things (IoT). It defines IoT and describes its characteristics, physical and logical design, enabling technologies, and deployment levels. The physical design covers IoT devices, protocols, and communication layers. The logical design includes functional blocks, communication models, and APIs. Enabling technologies include wireless sensor networks, cloud computing, big data analysis, communication protocols, and embedded systems. IoT deployment levels range from single node local systems to multi-node systems with local coordination and cloud-based storage, analysis and applications.
The document discusses Internet of Things (IoT) and provides definitions for key concepts related to IoT. It covers topics like IoT architecture with different levels, communication protocols used at various layers of IoT including TCP, UDP, HTTP, CoAP, MQTT, etc. It also defines embedded systems, wireless sensor networks, cloud computing models and their relationship with IoT. The document provides 95 questions with answers to help understand fundamentals of IoT.
An operating system is software that acts as an interface between computer hardware and users, allowing applications to run and perform tasks. The main functions of an operating system include process management, memory management, file management, device management, I/O system management, and security. The kernel is the central component of the operating system and enables communication between hardware and software. Mainframe systems evolved from early batch systems with no user interaction to time-sharing systems that allowed for simultaneous multi-user interaction through rapid switching between users.
Deadlock occurs when multiple processes are blocked waiting for resources held by other processes in the system, resulting in a cyclic dependency. There are four conditions required for deadlock: mutual exclusion, hold and wait, no preemption, and circular wait. An operating system can address deadlock through prevention, detection, or avoidance techniques. Prevention assigns resources in a way that deadlock cannot occur. Detection identifies when deadlock has occurred and resolves it. Avoidance dynamically analyzes resource allocation requests to determine if granting it could potentially lead to deadlock.
Process synchronization is used to coordinate processes that share resources so they do not interfere with each other. It uses mechanisms like semaphores and monitors to control access to shared data and order the interactions between processes. The main purposes are to allow sharing of resources without conflict using mutual exclusion and to coordinate process interactions in an operating system.
The document discusses monitors, which are a synchronization mechanism that allows only one process to access shared resources or execute code inside the monitor at a time. Monitors contain condition variables and procedures that allow processes to wait on or signal conditions. They provide a high-level way to achieve process synchronization and simplify dealing with synchronization problems compared to other techniques like semaphores. While monitors make parallel programming easier, they must be implemented by the programming language and compiler, increasing their burden.
The document contains source code for several .NET programming examples including currency conversion, degree conversion, string manipulation, calculator, and employee salary calculation. The code demonstrates how to design forms, add controls, handle events, perform calculations and insert data into a SQL database. Output for the examples is not shown. The last example contains code to calculate an employee's gross pay and net pay based on their base pay and standard deductions.
The document contains source code from multiple .NET programming lab exercises conducted by Dr. M. Karthika of the IT Department. The code examples demonstrate various .NET concepts like constructors, inheritance, polymorphism, exceptions, delegates, and threading. For example, one code sample shows the use of a constructor to initialize width and length properties of a Rectangle class. Another shows single inheritance by deriving a Triangle class from a base Shape class.
This document contains source code for 10 programming exercises in C# .NET: 1) multiplication table; 2) perfect number checker; 3) Armstrong number checker; 4) palindrome number checker; 5) digit sum calculator; 6) prime number generator within a range; 7) Floyd's triangle generator; 8) ASCII value finder; 9) factor finder; 10a) decimal to binary converter and 10b) binary to decimal converter. For each exercise, the source code is provided along with sample input/output. The code includes classes, methods to get input, perform calculations and display output, and loops to allow running the programs multiple times.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
1. MCA DEPARTMENT | Operators& Expressions
C
1
Operators:
The symbols which are used to perform logical and
mathematical operations in a C program are called C
operators.
These C operators join individual constants and
variables to form expressions.
Operators, functions, constants and variables are
combined together to form expressions.
Consider the expression A + B * 5. where, +, * are
operators, A, B are variables, 5 is constant and A + B * 5
is an expression.
Types ofC operators:
C language offers many types of operators.
They are,
1. Arithmetic operators
2. Assignment operators
3. Relational operators
4. Logical operators
5. Bit wise operators
6. Conditional operators (ternary operators)
7. Increment/decrement operators
8. Special operators
C operators:
S.no Types of Operators Description
1 Arithmeticoperators
These are used to perform
mathematical calculations like
addition, subtraction,
multiplication, division and
modulus
2 Assignmen_operators
These are used to assign
the valuesfor the variablesin C
programs.
3 Relational operators
These operators are used
to compare the value of two
variables.
4 Logical operators
These operators are used to
perform logical operations on
the given two variables.
5 Bit wise operators
These operators are used to
perform bit operations on
given two variables.
6
Conditional (ternary)
operators
Conditional operators return
one value if condition is true
and returns another value is
condition is false.
7
Increment/decrement
operators
These operators are used to
either increase or decrease the
value of the variable by one.
8 Special operators
&, *, sizeof( ) and ternary
operators.
1. AirthmeticOperators
operator Description Example
+ Adds two operands A + B will give its sum
-
Subtracts second operand
from the first
A - B will give the subtracted
value
* Multiply both operands
A * B will give the multiplied
value
/
Divide numerator by
denominator
B / A will give the quotient
%
Modulus Operator and
remainder of after an
integer division
B % A will give remainder
++
Increment operator,
increases integer value by
one
A++ will give incremented
value by 1
--
Decrement operator,
decreases integer value by
one
A-- will give decremented
by 1
Ex:1 // use of arithmeticoperators
#include<stdio.h>
void main()
{
int a = 21;
int b = 10;
int c ;
c = a + b;
OPERATORS AND EXPRESSIONS
2. MCA DEPARTMENT | Operators& Expressions
C
2
printf("Line 1- Value of c is%dn", c );
c = a - b;
printf("Line 2- Value of c is%dn", c );
c = a * b;
printf("Line 3- Value of c is%dn", c );
c = a / b;
printf("Line 4- Value of c is%dn", c );
c = a % b;
printf("Line 5- Value of c is%dn", c );
c = a++;
printf("Line 6- Value of c is%dn", c );
c = a--;
printf("Line 7- Value of c is%dn", c );
}
Output:
Line 1 - Value of c is 31
Line 2 - Value of c is 11
Line 3 - Value of c is 210
Line 4 - Value of c is 2
Line 5 - Value of c is 1
Line 6 - Value of c is 21
Line 7 - Value of c is 22
Ex:2
/* Program to demonstrate the workingof arithmetic operators
in C. */
#include <stdio.h>
int main(){
int a=9,b=4,c;
c=a+b;
printf("a+b=%dn",c);
c=a-b;
printf("a-b=%dn",c);
c=a*b;
printf("a*b=%dn",c);
c=a/b;
printf("a/b=%dn",c);
c=a%b;
printf("Remainderwhena dividedbyb=%dn",c);
return 0;
}
Output:
a+b=13
a-b=5
a*b=36
a/b=2
Remainderwhena dividedby b=1
Ex:3
//Suppose a=5.0, b=2.0, c=5 and d=2
#include <stdio.h>
int main(){
float a=5.0, b=2.0;
c=a+b;
printf("a+b=%fn",c);
c=a-b;
printf("a-b=%fn",c);
c=a*b;
printf("a*b=%fn",c);
c=a/b;
printf("a/b=%fn",c);
return 0;
}
Output:
a+b=7.0
a-d=3.0
a/b=2.5
Note: % operator can onlybe used with integers.
2. AssignmentOperators
The most common assignmentoperator is =. This operator
assigns the value inright side to the leftside.For example:
var=5 //5 is assignedto var
a=c; //value of c is assignedto a
5=c; // Error! 5 is a constant.
Operator Example Same as
= a=b a=b
+= a+=b a=a+b
-= a-=b a=a-b
*= a*=b a=a*b
/= a/=b a=a/b
%= a%=b a=a%b
3. MCA DEPARTMENT | Operators& Expressions
C
3
Ex: 4
//use of assignment operator
#include<stdio.h>
int main()
{
int a = 21;
int c ;
c = a;
printf("Line 1 - = Operator Example, Value of c = %dn", c );
c += a;
printf("Line 2 - += Operator Example, Value of c = %dn", c );
c -= a;
printf("Line 3 - -= Operator Example, Value of c = %dn", c );
c *= a;
printf("Line 4 - *= Operator Example, Value of c = %dn", c );
c /= a;
printf("Line 5 - /= Operator Example, Value of c = %dn", c );
c = 200;
c %= a;
printf("Line 6 - %= Operator Example, Value of c = %dn", c );
c <<= 2;
printf("Line 7 - <<= Operator Example, Value of c = %dn", c );
c >>= 2;
printf("Line 8 - >>= Operator Example, Value of c = %dn", c );
c &= 2;
printf("Line 9 - &= Operator Example, Value of c = %dn", c );
c ^= 2;
printf("Line 10 - ^= Operator Example, Value of c = %dn", c );
c |= 2;
printf("Line 11 - |= Operator Example, Value of c = %dn", c );
return 0;
}
Output:
Line 1 - = Operator Example, Value of c = 21
Line 2 - += Operator Example, Value of c = 42
Line 3 - -= Operator Example, Value of c = 21
Line 4 - *= Operator Example, Value of c = 441
Line 5 - /= Operator Example, Value of c = 21
Line 6 - %= Operator Example, Value of c = 11
Line 7 - <<= Operator Example, Value of c = 44
Line 8 - >>= Operator Example, Value of c = 11
Line 9 - &= Operator Example, Value of c = 2
Line 10 - ^= Operator Example, Value of c = 0
Line 11 - |= Operator Example, Value of c = 2
3. Relational Operator
Relational operators checks relationshipbetweentwo
operands.
If the relationis true,it returns value 1 and if the
relationis false,it returns value 0.
Operator Meaning of Operator Example
== Equal to 5==3 returnsfalse (0)
> Greater than 5>3 returns true (1)
< Less than 5<3 returns false (0)
!= Not equal to 5!=3 returnstrue(1)
>=
Greater than or equal
to
5>=3 returnstrue (1)
<= Less than or equal to 5<=3 return false (0)
Ex:5
// use of relational operator
#include <stdio.h>
int main()
{
int m=40,n=20;
if (m== n)
{
printf(“mand n are equal”);
}
else
{
printf(“mand n are not equal”);
}
}
Output:
m and n are not equal
4. Logical Operators
Logical operators are usedto combine expressionscontaining
relationoperators. In C, there are 3 logical operators:
4. MCA DEPARTMENT | Operators& Expressions
C
4
Operator
Meaning of
Operator
Example
&& Logial AND
If c=5 and d=2 then,((c==5) && (d>5)) returns
false.
|| Logical OR
If c=5 and d=2 then, ((c==5) || (d>5)) returns
true.
! Logical NOT If c=5 then, !(c==5) returns false.
Ex:6
// use of relational operators
#include <stdio.h>
int main()
{
int m=40,n=20;
int o=20,p=30;
if (m>n && m !=0)
{
printf(“&& Operator: Both conditionsare truen”);
}
if (o>p || p!=20)
{
printf(“||Operator : Only one conditionis truen”);
}
if (!(m>n&& m !=0))
{
printf(“!Operator : Both conditionsare truen”);
}
else
{
printf(“!Operator : Both conditionsare true. ”
“But, status is invertedas falsen”);
}
}
Output:
&& Operator : Both conditionsare true
|| Operator : Onlyone conditionis true
! Operator : Both conditionsare true. But, status isinvertedas
false
5. Bit wise operators
These operators are used to perform bit operations. Decimal
values are converted into binary values which are the
sequence of bits and bit wise operators work on these bits.
Bit wise operators in C language are & (bitwise AND), |
(bitwise OR), ~ (bitwise OR), ^ (XOR), << (left shift) and >>
(right shift).
Truth table for bit wise operation Bit wise operators
x y x|y x & y x ^ y Operator_symbol Operator_name
0 0 0 0 0 & Bitwise_AND
0 1 1 0 1 | Bitwise OR
1 0 1 0 1 ~ Bitwise_NOT
1 1 1 1 0 ^ XOR
<< Left Shift
>> Right Shift
Consider x=40 and y=80. Binary form of these values are
given below.
x = 00101000
y= 01010000
All bit wise operations for x and y are given below.
x&y = 00000000 (binary) = 0 (decimal)
x|y = 01111000 (binary) = 120 (decimal)
~x = 11111111111111111111111111
11111111111111111111111111111111010111
.. ..= -41 (decimal)
x^y = 01111000 (binary) = 120 (decimal)
x << 1 = 01010000 (binary) = 80 (decimal)
x >> 1 = 00010100 (binary) = 20 (decimal)
Note:
Bit wise NOT : Value of 40 in binary is
00000000000000000000000000000000
00000000000000000010100000000000.So, all 0′s are
converted into 1′s in bit wise NOT operation.
Bit wise left shift and right shift : In left shift operation “x <<
1 “, 1 means that the bits will be left shifted by one place. If
we use it as “x << 2 “, then, it means that the bits will be left
shifted by 2 places.
Example program for bit wise operators in C:
In this example program, bit wise operations are performed
as shown above and output is displayed in decimal format.
5. MCA DEPARTMENT | Operators& Expressions
C
5
EX:7
#include <stdio.h>
int main()
{
int m = 40,n = 80,AND_opr,OR_opr,XOR_opr,NOT_opr ;
AND_opr = (m&n);
OR_opr = (m|n);
NOT_opr = (~m);
XOR_opr = (m^n);
printf(“AND_opr value = %dn”,AND_opr );
printf(“OR_opr value = %dn”,OR_opr );
printf(“NOT_opr value = %dn”,NOT_opr );
printf(“XOR_opr value = %dn”,XOR_opr );
printf(“left_shift value = %dn”, m << 1);
printf(“right_shift value = %dn”, m >> 1);
}
Output:
AND_opr value = 0
OR_opr value = 120
NOT_opr value = -41
XOR_opr value = 120
left_shift value = 80
right_shift value = 20
6. Conditional or ternary operators:
Conditional operators return one value if condition is true
and returns another value is condition is false.
This operator is also called as ternary operator.
Syntax : (Condition? true_value: false_value);
Example : (A > 100 ? 0 : 1);
.
In above example, if A is greater than 100, 0 is returned else 1
is returned. This is equal to if else conditional statements.
Ex:8
// use of conditional operator
#include <stdio.h>
int main()
{
int x=1, y ;
y = ( x ==1 ? 2 : 0 ) ;
printf(“x value is %dn”, x);
printf(“y value is %d”, y);
}
Output:
x value is 1
y value is 2
6. Increment /Decrement operators
Increment operators are used to increase the value of the
variable by one and decrement operators are used to
decrease the value of the variable by one in C programs.
Syntax:
Increment operator: ++var_name; (or) var_name++;
Decrement operator: – -var_name; (or) var_name – -;
…
Example:
Increment operator : ++ i ; i ++ ;
Decrement operator : - - i ; i- - ;
Ex:9
//Example for increment operators
#include <stdio.h>
int main()
{
int i=1;
while(i<10)
{
printf("%d ",i);
i++;
}
}
Output:
1 2 3 4 5 6 7 8 9
Ex:10
//Example for decrement operators
#include <stdio.h>
int main()
{
int i=20;
while(i>10)
{
printf("%d ",i);
i--;
}
}
Output:
6. MCA DEPARTMENT | Operators& Expressions
C
6
20 19 18 17 16 15 14 13 12 11
Differencebetweenpre/postincrement&decrement
operatorsinC:
S.no Operator type Operator Description
1 Pre increment
++i Value of i is incremented before
assigning it to variable i.
2 Post-increment
i++ Value of i is incremented after
assigning it to variable i.
3 Pre decrement
– –i Value of i is decremented before
assigning it to variable i.
4 Post_decrement
i– – Value of i is decremented after
assigning it to variable i.
Ex: 11
//pre – increment operators in C:
//Example for increment operators
#include <stdio.h>
int main()
{
int i=0;
while(++i < 5 )
{
printf("%d ",i);
}
return 0;
}
Output:
1 2 3 4
Ex:12 // post – increment operators in C:
#include <stdio.h>
int main()
{
int i=0;
while(i++ < 5 )
{
printf("%d ",i);
}
return 0;
}
Output:
1 2 3 4 5
Ex:13
//pre - decrement operators in C:
#include <stdio.h>
int main()
{
int i=10;
while(--i > 5 )
{
printf("%d ",i);
}
return 0;
}
Output:
9 8 7 6
Ex:15
// post - decrement operators in C:
#include <stdio.h>
int main()
{
int i=10;
while(i-- > 5 )
{
printf("%d ",i);
}
return 0;
}
Output:
9 8 7 6 5
Ex:16
// & and * operators in C:
#include <stdio.h>
int main()
{
int *ptr, q;
q = 50;
/* address of q is assigned to ptr */
ptr = &q;
/* display q’s value using ptr variable */
printf(“%d”, *ptr);
return 0;
}
Output:
7. MCA DEPARTMENT | Operators& Expressions
C
7
50
Ex:17
//program for sizeof() operator in C:
#include <stdio.h>
#include <limits.h>
int main()
{
int a;
char b;
float c;
double d;
printf(“Storage size for int data type:%d n”,sizeof(a));
printf(“Storage size for char data type:%d n”,sizeof(b));
printf(“Storage size for float data type:%d n”,sizeof(c));
printf(“Storage size for double data type:%dn”,sizeof(d));
return 0;
}
Output:
Storage size for int data type:4
Storage size for char data type:1
Storage size for float data type:4
Storage size for double data type:8
Operator Precedence& Associativity
Category Operator Associativity
Postfix () [] -> . ++ - - Left to right
Unary
+ - ! ~ ++ - - (type) *
& sizeof
Right to left
Multiplicative * / % Left to right
Additive + - Left to right
Shift << >> Left to right
Relational < <= > >= Left to right
Equality == != Left to right
Bitwise AND & Left to right
Bitwise XOR ^ Left to right
Bitwise OR | Left to right
Logical AND && Left to right
Logical OR || Left to right
Conditional ?: Right to left
Assignment
= += -= *= /= %= >>=
<<= &= ^= |=
Right to left
Comma , Left to right
EXPRESSIONS
Combinations of operands and operators with seperators are called as
expressions.
Ex:
int a, b, c:
c = a+b; //--- Expression statement
TypeConversions
Converting from one data type to another data type is called
type conversion
There are two kinds of type conversion
Implicit: Same data type conversion
Smaller data type into bigger
(memory size)
Explicit: Different Data type
Type Casting
(Float--- int (or) int ---- float)
Ex:18
// Implicit conversion
#include <stdio.h>
int main() {
int a = 2;
double b = 3.5;
Type Conversion
Implicit Explicit
8. MCA DEPARTMENT | Operators& Expressions
C
8
double c = a * b;
double d = a / b;
int e = a * b;
int f = a / b;
printf("a=%d, b=%.3f, c=%.3f, d=%.3f, e=%d, f=%dn",
a, b, c, d, e, f);
return 0;
}
Ex:19
// Explicit Conversion (or) Type Casting
#include <stdio.h>
#include <stdio.h>
int main() {
int a = 2;
int b = 3;
printf("a / b = %.3fn", a/b);
printf("a / b = %.3fn", (double) a/b);
return 0;
}