The document discusses different types of control statements in C programming including decision control statements, iteration statements, and transfer statements. It provides details about if, if-else, switch, while, do-while, for loops. Decision control statements like if, if-else, switch allow altering the flow of execution based on certain conditions. Iteration statements like while, do-while, for are used to repeat a block of code until the given condition is true. They allow looping in a program.
The document discusses various control structures in C programming including branching, looping, and nested control structures. It provides examples of if-else statements, if-else-if ladders, nested if-else statements, and switch statements. Key points covered include the syntax and flow of if-else, if-else-if, and switch statements as well as differences between switch and if-else structures. Sample programs demonstrate using control structures to check conditions, find largest of three numbers, and calculate grades.
C language concept with code apna college.pdfmhande899
The document discusses various topics related to C language programming including variables, data types, constants, keywords, program structure, comments, input/output, compilation process, and an overview of topics to be covered in a C language tutorial from basic to advanced concepts. Specifically, it provides examples of variable declarations and definitions, basic program structure with main function, different ways to add comments, methods of accepting user input and printing output, and the compilation process to convert C code into executable files.
The document discusses various control flow statements in C programming language. It describes selection statements like if-else which allow a program to make decisions on the logical condition evaluated. It also covers iteration statements like while, do-while and for loops that allow repetitive execution of code. The switch statement provides an alternative to chained if-else conditions. Control flow statements allow writing powerful programs by selecting or repeating important sections of code conditionally.
computer programming Control Statements.pptxeaglesniper008
The document summarizes control statements in the C programming language. It discusses decision statements like if and switch statements. It also covers loop statements like for, do-while and while loops. The for loop is described as the most common loop in C. Examples are provided to illustrate if, switch and for statements. Key points covered include the syntax and flow of if-else, switch-case statements and for loops.
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESLeahRachael
This document summarizes operators in the C programming language. It discusses arithmetic, unary, relational, logical, and assignment operators. For each operator type, it provides examples of common operators like addition, subtraction, increment, decrement, equality, inequality and examples of how to use them in simple C code snippets. It also covers unary operators like unary minus and plus, and operators for type sizes like sizeof. Overall, the document serves as a basic introduction to different operator categories and syntax in C programming.
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 different types of control statements in C programming including decision control statements, iteration statements, and transfer statements. It provides details about if, if-else, switch, while, do-while, for loops. Decision control statements like if, if-else, switch allow altering the flow of execution based on certain conditions. Iteration statements like while, do-while, for are used to repeat a block of code until the given condition is true. They allow looping in a program.
The document discusses various control structures in C programming including branching, looping, and nested control structures. It provides examples of if-else statements, if-else-if ladders, nested if-else statements, and switch statements. Key points covered include the syntax and flow of if-else, if-else-if, and switch statements as well as differences between switch and if-else structures. Sample programs demonstrate using control structures to check conditions, find largest of three numbers, and calculate grades.
C language concept with code apna college.pdfmhande899
The document discusses various topics related to C language programming including variables, data types, constants, keywords, program structure, comments, input/output, compilation process, and an overview of topics to be covered in a C language tutorial from basic to advanced concepts. Specifically, it provides examples of variable declarations and definitions, basic program structure with main function, different ways to add comments, methods of accepting user input and printing output, and the compilation process to convert C code into executable files.
The document discusses various control flow statements in C programming language. It describes selection statements like if-else which allow a program to make decisions on the logical condition evaluated. It also covers iteration statements like while, do-while and for loops that allow repetitive execution of code. The switch statement provides an alternative to chained if-else conditions. Control flow statements allow writing powerful programs by selecting or repeating important sections of code conditionally.
computer programming Control Statements.pptxeaglesniper008
The document summarizes control statements in the C programming language. It discusses decision statements like if and switch statements. It also covers loop statements like for, do-while and while loops. The for loop is described as the most common loop in C. Examples are provided to illustrate if, switch and for statements. Key points covered include the syntax and flow of if-else, switch-case statements and for loops.
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESLeahRachael
This document summarizes operators in the C programming language. It discusses arithmetic, unary, relational, logical, and assignment operators. For each operator type, it provides examples of common operators like addition, subtraction, increment, decrement, equality, inequality and examples of how to use them in simple C code snippets. It also covers unary operators like unary minus and plus, and operators for type sizes like sizeof. Overall, the document serves as a basic introduction to different operator categories and syntax in C programming.
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 decision control instructions in C programming using if, if-else and conditional operators. It explains the syntax and usage of if, if-else-else statements with examples. Logical operators like &&, || and ! are described along with their usage in combining conditions. The conditional operator ?: is introduced with examples. Different methods to solve problems using decision control structures like nested if-else, logical operators and else-if are presented with examples.
This document discusses various control statements in C programming language. It explains decision making statements like if, if-else and nested if-else statements which allow a program to make decisions based on certain conditions. It also covers selection statements like switch case and iteration statements like for, while and do-while loops that allow repetitive execution of code. Finally, it describes jump statements like break, continue and goto that change the normal sequential flow of program execution. Examples are provided for each statement to illustrate their usage.
The document provides 20 programming problems and their solutions. Some of the key problems include: writing programs to calculate factorial using recursion, determine if a number is even or odd, swap two numbers using temporary/bitwise operators, find greatest of 3/10 numbers, check if a number is prime/palindromic, and check if a string is a palindrome. The solutions provide sample code snippets and explanations with examples to illustrate the logic.
The document discusses various C programming concepts including data types, variables, constants, and input/output functions. It covers fundamental data types like integers, floats, characters, and derived types like arrays, pointers, and structures. It also explains variable declaration syntax, integer and floating point input/output, and arithmetic, relational, logical, and conditional operators.
Detailing about basics of C language and its control structure for learning C Language for beginners. It covers looping statement , control statement etc.
The document discusses different types of selection and looping statements in C programming including if-else, if-else if-else, switch case, while loop, do-while loop, and for loop. It provides examples of each statement type and highlights important aspects like counter initialization, conditional expressions, and incrementing/decrementing counters. The differences between while, do-while and for loops are also summarized.
The document provides an outline of topics for a C/C++ tutorial, including a "Hello World" program, data types, variables, operators, conditionals, loops, arrays, strings, functions, pointers, command-line arguments, data structures, and memory allocation. It gives examples and explanations of key concepts in C/C++ programming.
C programming is a widely used programming language. The document provides an overview of key concepts in C programming including variables, data types, operators, decision and loop control statements, functions, pointers, arrays, strings, structures, and input/output functions. It also provides examples to illustrate concepts like arrays, strings, functions, pointers, and structures. The main function is the entry point for all C programs where code execution begins.
The document provides an overview of fundamental programming concepts in C language. It begins by comparing the steps to learning English and C, then discusses algorithms, flowcharts, tokens, data types, operators, control structures like if/else, switch, loops (while, do-while, for). It also covers nested loops, and illustrates an infinite loop that repeats until the user enters 'n'. The key topics covered include basic syntax, flow control, and programming constructs in C.
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 C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.
The C is the most widely used computer language, it keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.
The document discusses various topics related to tokens, variables, data types, and operators in C programming. It defines tokens as the smallest elements identified by the compiler, such as keywords, identifiers, string literals, and operators. It describes different variable types like local variables, global variables, and static variables. It also explains various data types in C like integer, float, char, etc and their sizes and ranges. Finally, it discusses various arithmetic, relational, logical, and assignment operators in C and their precedence.
The document discusses various conditional control statements in C language including if, if-else, nested if, if-else-if, switch case statements. It provides the syntax and examples for each statement. Key conditional control statements covered are:
1) if statement - Executes code if a condition is true.
2) if-else statement - Executes one block of code if condition is true and another if false.
3) Nested if statements - if statements within other if statements allow multiple conditions to be checked.
4) if-else-if statement - Allows multiple alternative blocks to be executed depending on different conditions.
5) switch case statement - Allows efficient selection from multiple discrete choices
This document contains C program code snippets and explanations for various programming problems including:
1) Finding perfect, Armstrong, and prime numbers as well as reversing, summing digits, and checking palindromes of numbers.
2) Converting between decimal and binary, multiplying matrices, and calculating LCM and factorial.
3) Checking for leap years and strong, palindrome, and generic root of numbers.
This document provides an overview of various programming concepts including variables, data types, decision making statements, loops, and more. It defines variables as named storage areas that can be manipulated by programs. Common variable types like char, int, float, and double are described along with their characteristics. Syntax and examples are given for if/else statements, switch statements, ternary operators, break, continue, and the various loop structures like for, while, and do-while loops. The document concludes by advertising an online programming course offered by Baabtra and providing contact information.
This document provides an overview of basic C programming concepts including data types, type conversion, conditional statements, and the switch statement. It discusses various data types in C like integer, float, and double. It explains implicit and explicit type conversion. Conditional statements covered are if, else, else if, and examples of using them. The switch statement syntax and rules are defined. Sample programs are provided for finding the maximum of numbers, checking positive/negative/zero, divisibility, and leap years.
This document discusses various concepts related to C programming including data types, operators, decision making statements, and loops. It begins with an example "Hello World" C program and explains each part. It then covers various data types in C like integer, float, char, etc. along with their sizes and ranges. Different types of operators like arithmetic, logical, assignment, increment/decrement are described. Decision making statements like if, if-else, if-else ladder, nested if, switch case are explained with examples. Finally, it briefly introduces the three types of loops in C - while, do-while, and for loops.
BRANCHING STATEMENTS
if statement
if – else statement
if – else if ladder
Nested if
Goto
Switch case
programs
output
flowchart
Branching / Decision Making Statements
The statements in the program that helps to transfer the control from one part to other parts of the program.
Facilitates program in determining the flow of control
Involves decision making conditions
See whether the condition is satisfied or not
If statement; Execute a set of command line or one command line when the logical condition is true.
It has only one option
syntax with flowchart
If else if ladder; Number of logical statements are checked for executing various statement
If the first condition is true the compiler executes the block followed by first if condition.
If false it skips the block and checks for the next logical condition followed by else if.
Process is continued until a true condition is occurred or an else condition is satisfied.
Switch case; Multiway branch statement
It only requires one argument of any type, which is checked with number of cases.
If the value matches with the case constant, that particular case constant is executed. If not the default statement is executed.
Break statement – used to exit from current case structure
Nested if else; When a series of decisions are involved we use more than one if-else statement.
If condition is true control passes to first block i.e., if block. In this case there may be one more if block.
If condition is false control passes to else block. There we may have one more if block.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
More Related Content
Similar to M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
The document discusses decision control instructions in C programming using if, if-else and conditional operators. It explains the syntax and usage of if, if-else-else statements with examples. Logical operators like &&, || and ! are described along with their usage in combining conditions. The conditional operator ?: is introduced with examples. Different methods to solve problems using decision control structures like nested if-else, logical operators and else-if are presented with examples.
This document discusses various control statements in C programming language. It explains decision making statements like if, if-else and nested if-else statements which allow a program to make decisions based on certain conditions. It also covers selection statements like switch case and iteration statements like for, while and do-while loops that allow repetitive execution of code. Finally, it describes jump statements like break, continue and goto that change the normal sequential flow of program execution. Examples are provided for each statement to illustrate their usage.
The document provides 20 programming problems and their solutions. Some of the key problems include: writing programs to calculate factorial using recursion, determine if a number is even or odd, swap two numbers using temporary/bitwise operators, find greatest of 3/10 numbers, check if a number is prime/palindromic, and check if a string is a palindrome. The solutions provide sample code snippets and explanations with examples to illustrate the logic.
The document discusses various C programming concepts including data types, variables, constants, and input/output functions. It covers fundamental data types like integers, floats, characters, and derived types like arrays, pointers, and structures. It also explains variable declaration syntax, integer and floating point input/output, and arithmetic, relational, logical, and conditional operators.
Detailing about basics of C language and its control structure for learning C Language for beginners. It covers looping statement , control statement etc.
The document discusses different types of selection and looping statements in C programming including if-else, if-else if-else, switch case, while loop, do-while loop, and for loop. It provides examples of each statement type and highlights important aspects like counter initialization, conditional expressions, and incrementing/decrementing counters. The differences between while, do-while and for loops are also summarized.
The document provides an outline of topics for a C/C++ tutorial, including a "Hello World" program, data types, variables, operators, conditionals, loops, arrays, strings, functions, pointers, command-line arguments, data structures, and memory allocation. It gives examples and explanations of key concepts in C/C++ programming.
C programming is a widely used programming language. The document provides an overview of key concepts in C programming including variables, data types, operators, decision and loop control statements, functions, pointers, arrays, strings, structures, and input/output functions. It also provides examples to illustrate concepts like arrays, strings, functions, pointers, and structures. The main function is the entry point for all C programs where code execution begins.
The document provides an overview of fundamental programming concepts in C language. It begins by comparing the steps to learning English and C, then discusses algorithms, flowcharts, tokens, data types, operators, control structures like if/else, switch, loops (while, do-while, for). It also covers nested loops, and illustrates an infinite loop that repeats until the user enters 'n'. The key topics covered include basic syntax, flow control, and programming constructs in C.
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 C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.
The C is the most widely used computer language, it keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.
The document discusses various topics related to tokens, variables, data types, and operators in C programming. It defines tokens as the smallest elements identified by the compiler, such as keywords, identifiers, string literals, and operators. It describes different variable types like local variables, global variables, and static variables. It also explains various data types in C like integer, float, char, etc and their sizes and ranges. Finally, it discusses various arithmetic, relational, logical, and assignment operators in C and their precedence.
The document discusses various conditional control statements in C language including if, if-else, nested if, if-else-if, switch case statements. It provides the syntax and examples for each statement. Key conditional control statements covered are:
1) if statement - Executes code if a condition is true.
2) if-else statement - Executes one block of code if condition is true and another if false.
3) Nested if statements - if statements within other if statements allow multiple conditions to be checked.
4) if-else-if statement - Allows multiple alternative blocks to be executed depending on different conditions.
5) switch case statement - Allows efficient selection from multiple discrete choices
This document contains C program code snippets and explanations for various programming problems including:
1) Finding perfect, Armstrong, and prime numbers as well as reversing, summing digits, and checking palindromes of numbers.
2) Converting between decimal and binary, multiplying matrices, and calculating LCM and factorial.
3) Checking for leap years and strong, palindrome, and generic root of numbers.
This document provides an overview of various programming concepts including variables, data types, decision making statements, loops, and more. It defines variables as named storage areas that can be manipulated by programs. Common variable types like char, int, float, and double are described along with their characteristics. Syntax and examples are given for if/else statements, switch statements, ternary operators, break, continue, and the various loop structures like for, while, and do-while loops. The document concludes by advertising an online programming course offered by Baabtra and providing contact information.
This document provides an overview of basic C programming concepts including data types, type conversion, conditional statements, and the switch statement. It discusses various data types in C like integer, float, and double. It explains implicit and explicit type conversion. Conditional statements covered are if, else, else if, and examples of using them. The switch statement syntax and rules are defined. Sample programs are provided for finding the maximum of numbers, checking positive/negative/zero, divisibility, and leap years.
This document discusses various concepts related to C programming including data types, operators, decision making statements, and loops. It begins with an example "Hello World" C program and explains each part. It then covers various data types in C like integer, float, char, etc. along with their sizes and ranges. Different types of operators like arithmetic, logical, assignment, increment/decrement are described. Decision making statements like if, if-else, if-else ladder, nested if, switch case are explained with examples. Finally, it briefly introduces the three types of loops in C - while, do-while, and for loops.
BRANCHING STATEMENTS
if statement
if – else statement
if – else if ladder
Nested if
Goto
Switch case
programs
output
flowchart
Branching / Decision Making Statements
The statements in the program that helps to transfer the control from one part to other parts of the program.
Facilitates program in determining the flow of control
Involves decision making conditions
See whether the condition is satisfied or not
If statement; Execute a set of command line or one command line when the logical condition is true.
It has only one option
syntax with flowchart
If else if ladder; Number of logical statements are checked for executing various statement
If the first condition is true the compiler executes the block followed by first if condition.
If false it skips the block and checks for the next logical condition followed by else if.
Process is continued until a true condition is occurred or an else condition is satisfied.
Switch case; Multiway branch statement
It only requires one argument of any type, which is checked with number of cases.
If the value matches with the case constant, that particular case constant is executed. If not the default statement is executed.
Break statement – used to exit from current case structure
Nested if else; When a series of decisions are involved we use more than one if-else statement.
If condition is true control passes to first block i.e., if block. In this case there may be one more if block.
If condition is false control passes to else block. There we may have one more if block.
Similar to M2 (1).pptxisedepofengiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii (20)
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Sinan KOZAK
Sinan from the Delivery Hero mobile infrastructure engineering team shares a deep dive into performance acceleration with Gradle build cache optimizations. Sinan shares their journey into solving complex build-cache problems that affect Gradle builds. By understanding the challenges and solutions found in our journey, we aim to demonstrate the possibilities for faster builds. The case study reveals how overlapping outputs and cache misconfigurations led to significant increases in build times, especially as the project scaled up with numerous modules using Paparazzi tests. The journey from diagnosing to defeating cache issues offers invaluable lessons on maintaining cache integrity without sacrificing functionality.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSIJNSA Journal
The smart irrigation system represents an innovative approach to optimize water usage in agricultural and landscaping practices. The integration of cutting-edge technologies, including sensors, actuators, and data analysis, empowers this system to provide accurate monitoring and control of irrigation processes by leveraging real-time environmental conditions. The main objective of a smart irrigation system is to optimize water efficiency, minimize expenses, and foster the adoption of sustainable water management methods. This paper conducts a systematic risk assessment by exploring the key components/assets and their functionalities in the smart irrigation system. The crucial role of sensors in gathering data on soil moisture, weather patterns, and plant well-being is emphasized in this system. These sensors enable intelligent decision-making in irrigation scheduling and water distribution, leading to enhanced water efficiency and sustainable water management practices. Actuators enable automated control of irrigation devices, ensuring precise and targeted water delivery to plants. Additionally, the paper addresses the potential threat and vulnerabilities associated with smart irrigation systems. It discusses limitations of the system, such as power constraints and computational capabilities, and calculates the potential security risks. The paper suggests possible risk treatment methods for effective secure system operation. In conclusion, the paper emphasizes the significant benefits of implementing smart irrigation systems, including improved water conservation, increased crop yield, and reduced environmental impact. Additionally, based on the security analysis conducted, the paper recommends the implementation of countermeasures and security approaches to address vulnerabilities and ensure the integrity and reliability of the system. By incorporating these measures, smart irrigation technology can revolutionize water management practices in agriculture, promoting sustainability, resource efficiency, and safeguarding against potential security threats.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMHODECEDSIET
Time Division Multiplexing (TDM) is a method of transmitting multiple signals over a single communication channel by dividing the signal into many segments, each having a very short duration of time. These time slots are then allocated to different data streams, allowing multiple signals to share the same transmission medium efficiently. TDM is widely used in telecommunications and data communication systems.
### How TDM Works
1. **Time Slots Allocation**: The core principle of TDM is to assign distinct time slots to each signal. During each time slot, the respective signal is transmitted, and then the process repeats cyclically. For example, if there are four signals to be transmitted, the TDM cycle will divide time into four slots, each assigned to one signal.
2. **Synchronization**: Synchronization is crucial in TDM systems to ensure that the signals are correctly aligned with their respective time slots. Both the transmitter and receiver must be synchronized to avoid any overlap or loss of data. This synchronization is typically maintained by a clock signal that ensures time slots are accurately aligned.
3. **Frame Structure**: TDM data is organized into frames, where each frame consists of a set of time slots. Each frame is repeated at regular intervals, ensuring continuous transmission of data streams. The frame structure helps in managing the data streams and maintaining the synchronization between the transmitter and receiver.
4. **Multiplexer and Demultiplexer**: At the transmitting end, a multiplexer combines multiple input signals into a single composite signal by assigning each signal to a specific time slot. At the receiving end, a demultiplexer separates the composite signal back into individual signals based on their respective time slots.
### Types of TDM
1. **Synchronous TDM**: In synchronous TDM, time slots are pre-assigned to each signal, regardless of whether the signal has data to transmit or not. This can lead to inefficiencies if some time slots remain empty due to the absence of data.
2. **Asynchronous TDM (or Statistical TDM)**: Asynchronous TDM addresses the inefficiencies of synchronous TDM by allocating time slots dynamically based on the presence of data. Time slots are assigned only when there is data to transmit, which optimizes the use of the communication channel.
### Applications of TDM
- **Telecommunications**: TDM is extensively used in telecommunication systems, such as in T1 and E1 lines, where multiple telephone calls are transmitted over a single line by assigning each call to a specific time slot.
- **Digital Audio and Video Broadcasting**: TDM is used in broadcasting systems to transmit multiple audio or video streams over a single channel, ensuring efficient use of bandwidth.
- **Computer Networks**: TDM is used in network protocols and systems to manage the transmission of data from multiple sources over a single network medium.
### Advantages of TDM
- **Efficient Use of Bandwidth**: TDM all
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Advanced control scheme of doubly fed induction generator for wind turbine us...IJECEIAES
This paper describes a speed control device for generating electrical energy on an electricity network based on the doubly fed induction generator (DFIG) used for wind power conversion systems. At first, a double-fed induction generator model was constructed. A control law is formulated to govern the flow of energy between the stator of a DFIG and the energy network using three types of controllers: proportional integral (PI), sliding mode controller (SMC) and second order sliding mode controller (SOSMC). Their different results in terms of power reference tracking, reaction to unexpected speed fluctuations, sensitivity to perturbations, and resilience against machine parameter alterations are compared. MATLAB/Simulink was used to conduct the simulations for the preceding study. Multiple simulations have shown very satisfying results, and the investigations demonstrate the efficacy and power-enhancing capabilities of the suggested control system.
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
3. Some more Arithmetic Operators
Prefix Increment : ++a
example: int a=5;
b=++a; // value of b=6; a=6;
Postfix Increment: a++
example: int a=5;
b=a++; // value of b=5; a=6;
4. Continued…
Modulus (remainder): %
example:
12%5 = 2;
Assignment by addition: +=
example:
int a=4;
a+=1; //(means a=a+1) value of a becomes 5
Can use -, /, *, % also
5. Continued…
Comparison (Relational ) Operators:
<, > , <=, >= , !=, ==
Logical Operators: !, &&, ||
example:
int a=4, b=5;
a<b returns a true(non zero number) value.
Bitwise Operators: <<, >>, ~, &, | ,^ .
example:
int a=8;
a= a>>1; // value of a becomes 4
8. Truth Table For Bit Wise Operation
& – Bitwise AND
| – Bitwise OR
~ – Bitwise NOT
^ – XOR
<< – Left Shift
>> – Right Shift
9. Operator Precedence
Meaning of a + b * c ?
is it a+(b*c) or (a+b)*c ?
All operators have precedence over each other
*, / have more precedence over +, - .
If both *, / are used, associativity comes into picture. (more on this later)
example : 5+4*3 = 5+12= 17.
10. 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);
20. 20
#include <stdio.h>
int main()
{
char c;
printf("Enter a character: ");
// Reads character input from the user
scanf("%c", &c);
// %d displays the integer value of a character
// %c displays the actual character
printf("ASCII value of %c = %d", c, c);
return 0;
}
Print ASCII Value
22. Type Conversion
Converting the value of one data type (int, float, double, etc.) to
another data type.
This process is known as type conversion.
24. There are two types of type conversion:
Implicit Conversion
Explicit Conversion
In implicit type conversion, the value of one type is automatically
converted to the value of another type.
In explicit type conversion, we manually convert values of one
data type to another type.
25. Implicit type conversion example
#include<stdio.h>
int main ( )
{
// character variable
char alphabet = 'a';
printf("Character Value: %cn", alphabet);
// assign character value to integer variable
int number = alphabet;
printf("Integer Value: %d", number);
return 0;
}
26. Explicit type conversion example
#include<stdio.h>
int main() {
// create an integer variable
int number = 35;
printf("Integer Value: %dn", number);
// explicit type conversion
double value = (double) number;
printf("Double Value: %.2lf", value);
return 0;
}
27. C –Type Casting
Converting one datatype into another is known as type casting
or, type-conversion. For example, if you want to store a 'long'
value into a simple integer then you can type cast 'long' to 'int’.
You can convert the values from one type to another explicitly
using the cast operator as follows − (type_name) expression
28. C Program for floating-point operation
#include <stdio.h>
main ( )
{
int sum = 17, count = 5;
double mean;
mean = (double) sum / count;
printf("Value of mean : %fn", mean );
}
29. Integer promotion is the process by which values of integer type "smaller"
than int or unsigned int are converted either to int or unsigned int.
Usual Arithmetic Conversion
The usual arithmetic conversions are implicitly performed to cast their
values to a common type. The compiler first performs integer promotion; if
the operands still have different types, then they are converted to the type
that appears highest in the following hierarchy −
30.
31. //C Program of adding a character with an integer
#include <stdio.h>
main() {
int i = 17;
char c = 'c'; /* ascii value is 99 */
int sum;
sum = i + c;
printf("Value of sum : %dn", sum );
}
32. Control Statements or Flow Control
Sequence Control Statements
Decision Control Statements
Loop Control Statements
Case Control Statements
34. The if statement
if ( this condition is true )
execute this statement ;
if ( this condition is true )
{
execute this block;
}
35. The if statement
if ( this condition is true )
execute this statement ;
if ( this condition is true )
{
execute this block;
}
36. 36
void main ( )
{
int n ;
printf ( "Enter a number n" ) ;
scanf ( "%d", &n ) ;
if ( n < =100 )
printf ( “The number is less than or equal to 100" ) ;
}
The if statement example
37. The if-else statement
if ( this condition is true )
execute this statement ;
else
execute this statement ;
if ( this condition is true )
{
execute this block;
}
else
{
execute this block;
}
38. 38
void main( )
{
int n ;
printf ( "Enter a number n" ) ;
scanf ( "%d", &n ) ;
if ( n <= 100 )
printf ( “The number is less than or equal to 100" ) ;
else
printf ( “The number is greater than 100" ) ;
}
The if-else example
39. The if-else statement
if ( this condition is true )
execute this statement ;
else
execute this statement ;
if ( this condition is true )
{
execute this block;
}
else
{
execute this block;
}
40. The else-if statement
if ( expression )
execute this statement ;
else if ( expression )
execute this statement ;
else if ( expression )
execute this statement ;
else if ( expression )
execute this statement ;
else
execute this statement ;
Multi-way
decision
Note:
Last else is
optional
41. Nesting of if-else statements
if (expression1)
{
// code to be executed
if (expression2)
{
// code to be executed
// if condition2 is true
}
}
42. Switch case statements
switch( expression )
{
case value-1: Block-1;
break;
case value-2: Block-2;
break;
…………………
case value-n: Block-n;
break;
default:
Block-1;
break;
}
Statement-x; Note: default is optional
expression can
be integral or
character
43. 43
#include <stdio.h>
int main()
{
int x;
printf (“Enter your choice”);
scanf (“%d”,&x);
switch (x)
{
case 1: printf("Choice is 1");
break;
case 2: printf("Choice is 2");
break;
case 3: printf("Choice is 3");
break;
default: printf("Choice other than 1, 2 and 3");
break;
}
return 0;
}
Switch case example
44. 44
switch ( marks / 10 )
{
case 4 :
case 5 : grade = ‘D’; break;
case 6 :
case 7 : grade = ‘C’; break;
case 8 :
case 9 : grade = ‘B’; break;
case 10 : grade = ‘A’; break;
default : grade = ‘F’; break;
}
Switch case example
45. Difference between if-else and switch
“If-else” can evaluate float conditions, “switch” cannot.
“If-else” can evaluate relational operators, “switch” cannot.
46. Switch Examples
Write a C program to print day of week name using switch case.
Write a C program to print number of days in a month using
switch case.
Write a C program to find maximum between two numbers using
switch case.
C program to check positive negative or zero using switch case.
47. 47
int main ( )
{
int num;
printf("Enter any number: ");
scanf("%d", &num);
switch (num > 0)
{ // Num is positive
case 1: printf("%d is positive.", num); break; // Num is either negative
or zero
case 0: switch (num < 0)
{
case 1: printf("%d is negative.", num);
break;
case 0: printf("%d is zero.", num); break; }
break;
}
return 0;
}
Program to check positive or negative or zero using switch
48. Example program
A commercial bank has introduced an incentive of giving bonus to all
its deposit holders. The policy is as follows: A bonus of 2 percent of the
balance held is given to every one and 5 percent is given to female
account holders if their balance is more than Rs.5000.
Note: Take gender using character variable. Example M means male
and F means female.
Inputs : Balance amount and the gender
Output: bonus and balance after adding bonus
49. The else-if statement
if ( expression )
execute this statement ;
else if ( expression )
execute this statement ;
else if ( expression )
execute this statement ;
else if ( expression )
execute this statement ;
else
execute this statement ;
Multi-way
decision
Note: Last else is
optional
51. Example Program
Write a C program to input marks of five subjects Physics,
Chemistry, Biology, Mathematics and Computer. Calculate
percentage and grade according to following:
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
52. 52
switch ( avg_marks / 10 )
{
case 0 :
case 1 :
case 2 :
case 3 : grade = ‘F’; break;
case 4 :
case 5 : grade = ‘E’; break;
case 6 : grade = ‘D’; break;
case 7 : grade = ‘C’; break;
case 8 : grade = ‘B’; break;
case 9 :
case 10 : grade = ‘A’; break;
default : grade = ‘F’; break;
}
Switch case example
53. The ? : operator
Ternary operator is used for decision making in place of conditional
statements if and else.
Takes three arguments.
conditional_expression ? value_if_true : value_if_false
int a = 10, b = 20, c;
if (a < b)
{ c = a;
}
else
{ c = b;
}
printf("%d", c);
int a = 10, b = 20, c;
c = (a < b) ? a : b;
printf("%d", c);
54. Example Program
Consider the weekly salary of a sales guy who is selling some products. If x
is the number of products sold in a week, his weekly salary is given by
4x+100 for x<40
Salary = 300 for x=40
4.5x+150 for x>40
56. Loops in C
A sequence of statements are executed until some conditions for
termination is satisfied.
Two parts:
1. Body of
the loop
2. Control
statement
57. Looping process steps
1. Setting and initialization of the condition variable
2. Execution of the statements in loop
3. Test for a specified value of the condition variable for execution of
the loop
4. Incrementing or updating the condition variable
58. Three types of loops
The while statement
The do-while statement
The for statement
59. The while statement
Entry controlled loop statement
The test condition is evaluated and if the condition is true, then the body of
the loop is executed.
while (test condition)
{
// statements inside the body of the loop
}
60. Print numbers from 1 to 5
60
#include <stdio.h>
int main()
{
int i = 1; // Initialization
while (i <= 5) // Testing
{
printf("%dn", i);
i++; // Incrementing
}
return 0;
}
61. While examples
Write a C program to find the sum of all integers between 1 and 10.
Write a C program to find the sum of squares of all integers between 1
and 10.
Write a program to evaluate the equation y=xn where n is a non
negative integer.
62. The do while statement
Exit controlled loop statement.
The body of the loop is executed first.
At the end of the loop, the test condition is evaluated.
do
{
// statements inside the body of the loop
}
while (test condition);
63. Program to add numbers until the user enters zero
63
#include <stdio.h>
void main()
{
double number, sum = 0;
// the body of the loop is executed at least once
do
{
printf("Enter a number: ");
scanf("%lf", &number);
sum += number;
}
while(number != 0.0);
printf("Sum = %.2lf",sum);
}
64. The for statement
Entry controlled loop, more concise loop control structure.
1. Initialization of the control variables is done first. Ex: i=0, count=0 (loop
control variables)
2. The value of the control variable is tested using the test condition. Ex:
i<10
3. When the body of the loop is executed, control is transferred back to for
statement. The control variable is incremented/updated using an
assignment statement. Ex: i=i+1
for (initialization; test_condition ; increment)
{
// statements inside the body of loop
}
66. Print numbers from 0 to 10
#include <stdio.h>
int main()
{
int i;
for (i = 0; i <= 10; ++i)
{
printf("%d ", i);
}
return 0;
}
67. For loop examples
Write a C program to find the sum of all integers between 1 and 10.
Write a C program to find the sum of squares of all integers between 1
and 10.
Write a program to evaluate the equation y=xn where n is a non
negative integer.
Write a program to find the factorial of a number.
Write a program to find the gcd of two numbers.
Write a program to print first 10 multiples of 5.
C program to add digits of a number:
68. Loop Control Statements
Loop control statements change execution from its normal
sequence.
Control Statement & Description
break statement
Terminates the loop or switch statement and transfers execution to the
statement immediately following the loop or switch.
continue statement
Causes the loop to skip the remainder of its body and immediately
retest its condition prior to reiterating.
goto statement
Transfers control to the labeled statement.
70. 70
// Program to calculate the sum of a maximum of 10 numbers
// If a negative number is entered, the loop terminates
void main()
{
int i;
double number, sum = 0.0;
for(i=1; i <= 10; ++i)
{
printf("Enter a n%d: ",i);
scanf("%lf",&number);
// If the user enters a negative number, the loop ends
if(number < 0.0)
{
break;
}
sum += number; // sum = sum + number;
}
printf("Sum = %.2lf",sum);
}
72. 72
// Program to calculate the sum of a maximum of 10 numbers
// Negative numbers are skipped from the calculation
void main()
{
int i;
double number, sum = 0.0;
for(i=1; i <= 10; ++i)
{
printf("Enter a n %d: ",i);
scanf("%lf",&number);
if(number < 0.0)
{
continue;
}
sum += number; // sum = sum + number;
}
printf("Sum = %.2lf",sum);
}
73. 73
break continue
A break can appear in both switch and loop
(for, while, do) statements.
A continue can appear only in loop
(for, while, do) statements.
A break causes the switch or loop statements
to terminate the moment it is executed. Loop
or switch ends abruptly when break is
encountered.
A continue doesn't terminate the loop, it
causes the loop to go to the next iteration. All
iterations of the loop are executed even
if continue is encountered.
The continue statement is used to skip
statements in the loop that appear after
the continue.
The break statement can be used in
both switch and loop statements.
The continue statement can appear only in
loops. You will get an error if this appears in
switch statement.
When a break statement is encountered, it
terminates the block and gets the control out
of the switch or loop.
When a continue statement is encountered, it
gets the control to the next iteration of the
loop.
A break causes the innermost enclosing loop
or switch to be exited immediately.
A continue inside a loop nested within
a switch causes the next loop iteration.
74. Infinite Loop
A loop becomes an infinite loop if a condition never becomes false.
The for or while loop is traditionally used.
Most of the time we create infinite loops by mistake.
Commonly used in programs that keep running for long periods of time
until they are stopped.0
#include <stdio.h>
int main ()
{
for( ; ; ) // or while(1)
{
printf("This loop will run forever.n");
}
return 0;
}
76. 76
int choice;
while(1)
{
printf(“1.Create databasen”);
printf(“2.Insert new recordn”);
printf(“3.Modify a recordn”);
printf(“4.Delete a recordn”);
printf(“5.Display all recordsn”);
printf(“6.Exitn”);
printf(“Enter your choice : “);
scanf(“%d”,&choice);
switch(choice)
{
case 1: printf(“Database created…..nn”); break;
case 2:printf(“Record inserted…..nn”);break;
case 3:printf(“Record modified…..nn”);break;
case 4:printf(“Record deleted…..nn”);break;
case 5:printf(“Records displayed…..nn”);break;
case 6:exit(1);
default:printf(“Wrong choicen”);
}
}
Infinite Loop example
79. Roots of a quadratic equation
a, b and c are known values. a can't be 0.
"x" is the variable or unknown.
80. Discriminant
b2 − 4ac in the formula is called the Discriminant, because it can
"discriminate" between the possible types of answer:
when b2 − 4ac is
positive, we get two Real solutions
Zero, we get just ONE real solution (both answers are the same)
Negative, we get a pair of Complex solutions
Ex: 5x2 + 6x + 1 = 0, Solution x = −0.2 or −1
81. Algorithm: Quadratic Equation
81
Step 1: Start
Step 2: Read the values of non-zero coefficients a,b and c.
Step 3: Compute the value of discriminant (disc) which is equal to (b*b-4*a*c).
Step 4: Check if disc is equal to 0. If true, then go toStep 5. Otherwise, go to Step 6
Step 5: Compute the roots.
root1 = (-b)/ (2*a) , root2=root1
Output the values of roots, root1 and root2. Go to Step 9.
Step 6: Check if disc is greater than zero or not. If true, then go to Step 7.Otherwise,
go to Step 8.
Step 7: Compute the real and distinct roots, root1 = (-b+sqrt(disc))/(2*a)
root2 = (-b-
sqrt(disc))/(2*a)
Output the values of roots, root1 and root2. Go to Step 9.
Step 8: Compute the complex and distinct roots.
Compute the real part, r_part = (-b)/(2*a)
Compute the imaginary part, i_part = sqrt(-disc)/(2*a)
Output roots as root1 = r_part + i_part
root2 = r_part – i_part
Step 9: Stop
83. Palindrome
int main()
{
int num,rev=0,rem,temp;
printf("Enter a number : ");
scanf("%d",&num);
temp = num;
while(num != 0)
{
rem=num%10;
rev= rev*10+rem;
num = num / 10;
}
printf("n The reverse of given number is %d ",rev);
if(temp==rev)
printf("n The given number %d is a Palindrome",temp);
else
printf("n The given number %d is not a Palindrome",temp);
}
84. Binomial coefficient
The binomial theorem describes the algebraic expansion of powers of
a binomial.
According to the theorem, it is possible to expand the
polynomial (x + y)n into a sum involving terms of the form axbyc
where the exponents b and c are nonnegative integers with b + c = n,
and
the coefficient a of each term is a specific positive integer depending
on n and b.
The coefficient a in the term of axbyc is known as the binomial
coefficient.
These coefficients for varying n and b can be arranged to form Pascal's
triangle.
For example (for n = 4)
88. The goto statement
To branch unconditionally from one point to another in the program.
Requires a label in order to identify the place where the branch is to be
made.
A label is any valid variable name followed by a colon.
goto label;
-----
-----
label:
statement;
label:
statement;
-----
-----
goto label;