The document discusses functions and pointers in C programming. It defines functions as reusable blocks of code that perform a specific task. Functions are declared with a return type, name, parameters, and body. Parameters can be passed by value or reference. Pointers are variables that store memory addresses. Pointer arithmetic and pointers with arrays are also covered. The document provides examples of different types of functions like those with and without return values and parameters. Recursion, where a function calls itself, and pointers are demonstrated through code examples.
This document discusses functions in C programming. It defines a function as a block of code that performs a specific task when called. It provides examples of functions used in hotel management like front office, reservation, and housekeeping. It explains function definition, declaration, calling, parameters, arguments, return statements. It differentiates between actual and formal arguments and discusses call by value and call by reference methods of passing arguments to functions.
This document discusses functions in C programming. It defines a function as a section of code that performs a specific task. Functions make programming simpler by splitting problems into smaller, more manageable sub-problems. The key advantages are that problems can be viewed at a smaller scope, program development is faster, and programs are easier to maintain. There are two types of functions - library functions provided by the language and user-defined functions written by the programmer. Functions can take parameters, perform operations, and return values. Well-structured functions are important for organizing code and solving complex problems.
hey this is Rupendra choudhary..!! i shared my "c" lang ppt..!!! u just goto that ppt if u r in deep with "c" ..!!! i create after i hv played a much with "c"..(sorry bt ppt is slightly disturbd may be due to unsupportable msppt2010 by slideshare)...find me on rupendrachoudhary1990@gmail.com or https://rupendrachoudhary.wordpress.com
This document discusses user-defined functions in C programming. It provides examples of functions with and without parameters and return values. It also demonstrates call by value and call by reference methods. The key points covered are:
1) User-defined functions allow programmers to define reusable blocks of code to perform tasks.
2) Functions can receive input from parameters and return outputs through return values.
3) Parameters passed by value are copied into the function, so changes made inside the function do not affect the original variables.
4) Parameters passed by reference allow the function to modify the original variables.
PowerPoint presentation of functions in C language. It will give you brief idea how function works in C along with its unique features like return statement.
A large program can be divided into smaller subprograms or functions. Functions make a program easier to write, read, update and debug by dividing it into self-contained tasks. Functions allow code to be reused and are called by the main program. Functions may accept arguments from the main program and return values to the main program. This allows two-way communication between functions and the main program.
1) Functions allow breaking down programs into smaller, self-contained blocks of code that perform specific tasks. Functions make code more organized and reusable.
2) There are two types of functions in C: library functions that are predefined in header files, and user-defined functions that are defined by the user.
3) Functions make code more modular and reusable by allowing the same block of code to be easily called multiple times by name rather than having to rewrite the block.
This document discusses functions in C programming. It defines functions as blocks of code that perform specific tasks. It explains the key components of functions - function declaration, definition, and call. It provides examples of defining, declaring, and calling functions. It also discusses recursion, system-defined library functions, and user-defined functions.
This document discusses functions in C programming. It defines a function as a block of code that performs a specific task when called. It provides examples of functions used in hotel management like front office, reservation, and housekeeping. It explains function definition, declaration, calling, parameters, arguments, return statements. It differentiates between actual and formal arguments and discusses call by value and call by reference methods of passing arguments to functions.
This document discusses functions in C programming. It defines a function as a section of code that performs a specific task. Functions make programming simpler by splitting problems into smaller, more manageable sub-problems. The key advantages are that problems can be viewed at a smaller scope, program development is faster, and programs are easier to maintain. There are two types of functions - library functions provided by the language and user-defined functions written by the programmer. Functions can take parameters, perform operations, and return values. Well-structured functions are important for organizing code and solving complex problems.
hey this is Rupendra choudhary..!! i shared my "c" lang ppt..!!! u just goto that ppt if u r in deep with "c" ..!!! i create after i hv played a much with "c"..(sorry bt ppt is slightly disturbd may be due to unsupportable msppt2010 by slideshare)...find me on rupendrachoudhary1990@gmail.com or https://rupendrachoudhary.wordpress.com
This document discusses user-defined functions in C programming. It provides examples of functions with and without parameters and return values. It also demonstrates call by value and call by reference methods. The key points covered are:
1) User-defined functions allow programmers to define reusable blocks of code to perform tasks.
2) Functions can receive input from parameters and return outputs through return values.
3) Parameters passed by value are copied into the function, so changes made inside the function do not affect the original variables.
4) Parameters passed by reference allow the function to modify the original variables.
PowerPoint presentation of functions in C language. It will give you brief idea how function works in C along with its unique features like return statement.
A large program can be divided into smaller subprograms or functions. Functions make a program easier to write, read, update and debug by dividing it into self-contained tasks. Functions allow code to be reused and are called by the main program. Functions may accept arguments from the main program and return values to the main program. This allows two-way communication between functions and the main program.
1) Functions allow breaking down programs into smaller, self-contained blocks of code that perform specific tasks. Functions make code more organized and reusable.
2) There are two types of functions in C: library functions that are predefined in header files, and user-defined functions that are defined by the user.
3) Functions make code more modular and reusable by allowing the same block of code to be easily called multiple times by name rather than having to rewrite the block.
This document discusses functions in C programming. It defines functions as blocks of code that perform specific tasks. It explains the key components of functions - function declaration, definition, and call. It provides examples of defining, declaring, and calling functions. It also discusses recursion, system-defined library functions, and user-defined functions.
The document discusses functions and recursion in C programming. It provides examples of different types of functions like void, float, int functions. It demonstrates simple functions with no parameters, functions that return values, and functions with parameters. It also explains recursion with examples of calculating factorials and Fibonacci series recursively. Finally, it discusses other function related concepts like function prototypes, scope of variables, and pre-defined math functions in C.
Functions in C can be divided into smaller subprograms to make programs more modular and easier to read, debug, and update. Functions allow code to be reused by calling the function multiple times. There are four main types of functions: functions with no arguments and no return value, functions with no arguments but a return value, functions with arguments but no return value, and functions with both arguments and a return value. Functions are defined with a return type, name, and list of parameters, and allow for modularization and passing of data between the calling function and called function.
The document discusses C programming functions. It provides examples of defining, calling, and using functions to calculate factorials, Fibonacci sequences, HCF and LCM recursively and iteratively. Functions allow breaking programs into smaller, reusable blocks of code. They take in parameters, can return values, and have local scope. Function prototypes declare their interface so they can be called from other code locations.
1. Functions allow programmers to break programs into smaller, self-contained subprograms, making code more modular and reusable.
2. There are four types of functions: those with no arguments and no return value, no arguments but a return value, arguments but no return value, and arguments with a return value.
3. Functions can be user-defined or library functions provided in standard libraries that perform common tasks like input/output and mathematics. Functions must be declared, defined, and called properly in a program.
There are two ways to initialize a structure:
1. Initialize structure members individually when declaring structure variables:
struct point {
int x;
int y;
} p1 = {1, 2};
2. Initialize an anonymous structure and assign it to a variable:
struct point p2 = {3, 4};
Structures allow grouping of related data types together under one name. They are useful for representing records, objects, and other data aggregates. Structures can contain nested structures as members. Arrays of structures are also possible. Structures provide data abstraction by allowing access to their members using dot operator.
A function is a block of code that performs a specific task. Functions allow for modularity and code reuse in a program. There are several key aspects of functions:
1. Functions are defined with a return type, name, and parameters. The general format is return_type function_name(parameter list).
2. Parameters allow functions to accept input from the caller. There are two ways parameters can be passed: call by value or call by reference.
3. Variables declared inside a function are local, while those declared outside are global and visible to all code. Local variables exist only during the function's execution.
4. Functions can call themselves recursively to repeat a task, with a base
Note: This slide was created by me. I am Md. Touhidul Islam Shawan. Here in these slide I have written about some basic points of function of c program and how the function works.
This document discusses functions in C programming, including defining functions, function prototypes, header files, calling functions by value and reference, recursion, and examples using recursion to calculate factorials and the Fibonacci series. Functions allow dividing programs into smaller, more manageable pieces. They are defined with a return type, name, and parameters. Function prototypes declare the function without defining the body. Header files contain function prototypes for libraries. Functions can be called by value, where copies of arguments are passed, or by reference, where the original arguments are passed. Recursion involves a function calling itself, terminating on a base case, to recursively solve problems like calculating factorials and the Fibonacci series.
The document discusses functions in C programming. It defines what a function is, how functions are declared and defined, how to pass arguments to functions, and different ways to call functions. It provides examples of using functions to calculate factorials, Fibonacci series, find the highest common factor and lowest common multiple of two numbers, and sum the digits of a number recursively. Various ways of implementing functions using loops, recursion, and by passing arguments are demonstrated through code examples.
Functions in C allow programmers to organize code into reusable blocks. A function performs a specific task and can optionally return a value. Functions make code easier to understand, share, and isolate errors. There are different types of functions including standard library functions and user-defined functions. Functions communicate through passing arguments, returning values, and pointers. Recursion involves a function calling itself to solve smaller instances of a problem.
The document discusses call-by-value in function invocation in C. When a function is called, only the values of the arguments are passed to the function, not the variables themselves. So any changes made to the parameters inside the function are not reflected in the calling function. This causes an issue when trying to swap variables by passing them to a Swap function.
The document discusses call by value and call by reference in functions. Call by value passes the actual value of an argument to the formal parameter, so any changes made to the formal parameter do not affect the actual argument. Call by reference passes the address of the actual argument, so changes to the formal parameter do directly modify the actual argument. An example program demonstrates call by value, where changing the formal parameter does not change the original variable.
Functions in C allow programmers to organize code into self-contained blocks that perform specific tasks. A function is defined with a name and can accept parameters. The main() function is where program execution begins. Several examples are provided that demonstrate defining and calling functions to perform tasks like addition, incrementing values, and displaying output. Functions can access variables in their own scope as well as variables passed into them as parameters.
This document discusses different types of functions in C programming. It provides examples of functions with no arguments and no return value, functions with arguments and no return value, functions with arguments and return value, functions with no arguments but return value, and functions that return multiple values. The examples demonstrate how to define and call each type of function.
Programming Fundamentals Arrays and Strings imtiazalijoono
This document provides an overview of arrays and strings in C programming. It discusses initializing and declaring arrays of different types, including multidimensional arrays. It also covers passing arrays as arguments to functions. For strings, it explains that strings are arrays of characters that are null-terminated. It provides examples of declaring and initializing string variables, and using string input/output functions like scanf() and printf().
This document provides information on functions in C and C++. It discusses the main components of functions including definition, declaration, prototypes, arguments, return values, scope, and recursion. It also covers function categories, nested functions, default arguments, inline functions, function overloading, and differences between calling functions by value versus reference in C++. Overall, the document serves as a tutorial on functions and their usage in C and C++ programming.
The document is a report on the topic of computer programming and utilization prepared by group C. It discusses functions, including the definition of a function, function examples, benefits of functions, function prototypes, function arguments, and recursion. It provides examples of math library functions, global and local variables, and external variables. It also includes examples of recursive functions to calculate factorials and the Fibonacci series recursively.
The document provides examples of using functions in C programming. It explains what a function is, how to define a function with return type, parameters, and body. It also discusses function declaration, calling a function, function arguments, and the difference between call by value and call by reference. Examples are given to demonstrate defining, declaring, calling functions, and how call by value does not actually change the argument values unlike call by reference. The document also briefly mentions formal parameters and how they behave like local variables inside a function.
The document discusses functions in C programming. It defines a function as a block of code that performs a specific task. Some key points:
- Functions allow breaking a program into smaller and reusable parts. The main() function is required in every C program.
- Functions are declared with a return type, name, and parameters. They are defined with a block of code enclosed in curly braces.
- Functions can be called from other functions and can call themselves recursively. However, a function cannot be defined within another function.
- By default, C uses call-by-value to pass arguments to functions. This means changes to parameters do not affect the original arguments. Call-by-reference uses
The document discusses functions and recursion in C programming. It provides examples of different types of functions like void, float, int functions. It demonstrates simple functions with no parameters, functions that return values, and functions with parameters. It also explains recursion with examples of calculating factorials and Fibonacci series recursively. Finally, it discusses other function related concepts like function prototypes, scope of variables, and pre-defined math functions in C.
Functions in C can be divided into smaller subprograms to make programs more modular and easier to read, debug, and update. Functions allow code to be reused by calling the function multiple times. There are four main types of functions: functions with no arguments and no return value, functions with no arguments but a return value, functions with arguments but no return value, and functions with both arguments and a return value. Functions are defined with a return type, name, and list of parameters, and allow for modularization and passing of data between the calling function and called function.
The document discusses C programming functions. It provides examples of defining, calling, and using functions to calculate factorials, Fibonacci sequences, HCF and LCM recursively and iteratively. Functions allow breaking programs into smaller, reusable blocks of code. They take in parameters, can return values, and have local scope. Function prototypes declare their interface so they can be called from other code locations.
1. Functions allow programmers to break programs into smaller, self-contained subprograms, making code more modular and reusable.
2. There are four types of functions: those with no arguments and no return value, no arguments but a return value, arguments but no return value, and arguments with a return value.
3. Functions can be user-defined or library functions provided in standard libraries that perform common tasks like input/output and mathematics. Functions must be declared, defined, and called properly in a program.
There are two ways to initialize a structure:
1. Initialize structure members individually when declaring structure variables:
struct point {
int x;
int y;
} p1 = {1, 2};
2. Initialize an anonymous structure and assign it to a variable:
struct point p2 = {3, 4};
Structures allow grouping of related data types together under one name. They are useful for representing records, objects, and other data aggregates. Structures can contain nested structures as members. Arrays of structures are also possible. Structures provide data abstraction by allowing access to their members using dot operator.
A function is a block of code that performs a specific task. Functions allow for modularity and code reuse in a program. There are several key aspects of functions:
1. Functions are defined with a return type, name, and parameters. The general format is return_type function_name(parameter list).
2. Parameters allow functions to accept input from the caller. There are two ways parameters can be passed: call by value or call by reference.
3. Variables declared inside a function are local, while those declared outside are global and visible to all code. Local variables exist only during the function's execution.
4. Functions can call themselves recursively to repeat a task, with a base
Note: This slide was created by me. I am Md. Touhidul Islam Shawan. Here in these slide I have written about some basic points of function of c program and how the function works.
This document discusses functions in C programming, including defining functions, function prototypes, header files, calling functions by value and reference, recursion, and examples using recursion to calculate factorials and the Fibonacci series. Functions allow dividing programs into smaller, more manageable pieces. They are defined with a return type, name, and parameters. Function prototypes declare the function without defining the body. Header files contain function prototypes for libraries. Functions can be called by value, where copies of arguments are passed, or by reference, where the original arguments are passed. Recursion involves a function calling itself, terminating on a base case, to recursively solve problems like calculating factorials and the Fibonacci series.
The document discusses functions in C programming. It defines what a function is, how functions are declared and defined, how to pass arguments to functions, and different ways to call functions. It provides examples of using functions to calculate factorials, Fibonacci series, find the highest common factor and lowest common multiple of two numbers, and sum the digits of a number recursively. Various ways of implementing functions using loops, recursion, and by passing arguments are demonstrated through code examples.
Functions in C allow programmers to organize code into reusable blocks. A function performs a specific task and can optionally return a value. Functions make code easier to understand, share, and isolate errors. There are different types of functions including standard library functions and user-defined functions. Functions communicate through passing arguments, returning values, and pointers. Recursion involves a function calling itself to solve smaller instances of a problem.
The document discusses call-by-value in function invocation in C. When a function is called, only the values of the arguments are passed to the function, not the variables themselves. So any changes made to the parameters inside the function are not reflected in the calling function. This causes an issue when trying to swap variables by passing them to a Swap function.
The document discusses call by value and call by reference in functions. Call by value passes the actual value of an argument to the formal parameter, so any changes made to the formal parameter do not affect the actual argument. Call by reference passes the address of the actual argument, so changes to the formal parameter do directly modify the actual argument. An example program demonstrates call by value, where changing the formal parameter does not change the original variable.
Functions in C allow programmers to organize code into self-contained blocks that perform specific tasks. A function is defined with a name and can accept parameters. The main() function is where program execution begins. Several examples are provided that demonstrate defining and calling functions to perform tasks like addition, incrementing values, and displaying output. Functions can access variables in their own scope as well as variables passed into them as parameters.
This document discusses different types of functions in C programming. It provides examples of functions with no arguments and no return value, functions with arguments and no return value, functions with arguments and return value, functions with no arguments but return value, and functions that return multiple values. The examples demonstrate how to define and call each type of function.
Programming Fundamentals Arrays and Strings imtiazalijoono
This document provides an overview of arrays and strings in C programming. It discusses initializing and declaring arrays of different types, including multidimensional arrays. It also covers passing arrays as arguments to functions. For strings, it explains that strings are arrays of characters that are null-terminated. It provides examples of declaring and initializing string variables, and using string input/output functions like scanf() and printf().
This document provides information on functions in C and C++. It discusses the main components of functions including definition, declaration, prototypes, arguments, return values, scope, and recursion. It also covers function categories, nested functions, default arguments, inline functions, function overloading, and differences between calling functions by value versus reference in C++. Overall, the document serves as a tutorial on functions and their usage in C and C++ programming.
The document is a report on the topic of computer programming and utilization prepared by group C. It discusses functions, including the definition of a function, function examples, benefits of functions, function prototypes, function arguments, and recursion. It provides examples of math library functions, global and local variables, and external variables. It also includes examples of recursive functions to calculate factorials and the Fibonacci series recursively.
The document provides examples of using functions in C programming. It explains what a function is, how to define a function with return type, parameters, and body. It also discusses function declaration, calling a function, function arguments, and the difference between call by value and call by reference. Examples are given to demonstrate defining, declaring, calling functions, and how call by value does not actually change the argument values unlike call by reference. The document also briefly mentions formal parameters and how they behave like local variables inside a function.
The document discusses functions in C programming. It defines a function as a block of code that performs a specific task. Some key points:
- Functions allow breaking a program into smaller and reusable parts. The main() function is required in every C program.
- Functions are declared with a return type, name, and parameters. They are defined with a block of code enclosed in curly braces.
- Functions can be called from other functions and can call themselves recursively. However, a function cannot be defined within another function.
- By default, C uses call-by-value to pass arguments to functions. This means changes to parameters do not affect the original arguments. Call-by-reference uses
This document discusses functions in C programming. It defines a function as a program segment that carries out a specific task. Functions allow programs to be developed in a modular way by dividing the program into reusable pieces. Functions can take parameters as input and return a value. Parameters are passed by value. Local variables declared within a function only exist for the duration of the function call. The document provides examples of defining, calling, and using return values from functions.
This document discusses functions in C programming. It defines a function as a program segment that carries out a specific task. Functions allow programs to be developed in a modular way by dividing the program into reusable pieces. Functions can take parameters as input and return a value. The key aspects covered include defining functions with a return type, parameters, and body, calling functions by passing actual parameters, and the scope of variables. Examples are provided to illustrate function definition, calling, parameters, return values, and recursion.
The document discusses functions in C programming. It defines functions as self-contained blocks of code that perform a specific task. Functions make a program modular and easier to debug. There are four main types of functions: functions with no arguments and no return value, functions with no arguments but a return value, functions with arguments but no return value, and functions with both arguments and a return value. Functions are called by their name and can pass data between the calling and called functions using arguments.
1. A function is a block of code that performs a specific task. Functions allow programmers to split a large program into smaller sub-tasks and call them multiple times.
2. There are two main types of functions - library functions provided by the standard library, and user-defined functions created by the programmer.
3. Functions make programs easier to write, read, update and debug by splitting them into smaller, well-defined tasks.
The document discusses functions in C programming. It defines functions as sub-programs that perform tasks when called. It describes pre-defined functions like sqrt(), abs(), pow() etc. and user-defined functions. User-defined functions are needed to break programs into modular pieces. Functions provide advantages like facilitating top-down programming and reusability. The document also discusses parameter passing methods like call by value and call by reference, and returning values from functions. Nesting and recursion of functions is explained with examples. Finally, it briefly discusses passing arrays and structures to functions.
The document discusses functions in C programming. It defines functions as self-contained blocks of code that perform a specific task. Functions make a program more modular and easier to debug by dividing a large program into smaller, simpler tasks. Functions can take arguments as input and return values. Functions are called from within a program to execute their code.
This document discusses modular programming and functions in C programming. Modular programming involves separating a program's functionality into independent, interchangeable modules. There are advantages to this approach such as improved manageability, reusability, and collaboration between programmers.
The document then discusses functions in C programming. Functions allow programmers to divide a program into reusable modules. There are two types of functions - standard library functions defined in header files, and user-defined functions. User-defined functions have advantages like making programs easier to understand, maintain, and debug. The key parts of a user-defined function are the declaration, definition, and call. Functions can take arguments, return values, and be used recursively. Arrays and 2D arrays
This document discusses different types of variables and functions in C programming. It defines user defined functions as functions designed by the user as opposed to pre-defined functions. It also categorizes functions based on whether they have arguments and return values. The document outlines the elements of a user defined function like declaration, definition, call. It further explains different storage classes like automatic, static, external and register variables.
This document discusses functions in C programming. It defines what a function is and explains why we use functions. There are two types of functions - predefined and user-defined. User-defined functions have elements like function declaration, definition, and call. Functions can pass parameters by value or reference. The document also discusses recursion, library functions, and provides examples of calculating sine series using functions.
The document discusses functions in computer programming. It defines functions as subprograms that allow code to be reused and tested in isolation. There are three main parts to a function: the definition, which specifies the return type, name, parameters and body; the declaration, which specifies the return type, name and parameters; and the call, which invokes the function. Functions can be categorized based on whether they have arguments and/or return values. Arrays can also be passed as arguments to functions.
This document discusses user defined functions in C programming. It defines functions as self-contained programs that can be divided into smaller modules to make programs more maintainable and readable. The key parts of a function are defined as the function prototype, definition, actual and formal arguments, and return statement. Functions allow for code reusability, modularity, easier debugging and maintenance of programs. Methods of passing arguments to functions include call by value and call by address.
The document discusses functions in C programming. It defines what a function is and explains why functions are used to avoid duplicating code and make programs easier to design, understand and maintain. It describes the different types of functions like pre-defined and user-defined functions. It also covers function prototypes, parameters, return values, recursion, library functions and pointers.
Functions are the building blocks where every program activity occurs. They are self-contained program segments that carry out some specific, well-defined task. Every C program must have a function c functions list. c functions multiple choice questions
Functions allow programmers to break programs into smaller, reusable parts. There are two types of functions in C: library functions and user-defined functions. User-defined functions make programs easier to understand, debug, test and maintain. Functions are declared with a return type and can accept arguments. Functions can call other functions, allowing for modular and structured program design.
Functions allow programmers to break programs into smaller, reusable parts. There are two types of functions in C: library functions and user-defined functions. User-defined functions make programs easier to understand, debug, test and maintain. Functions are declared with a return type and can accept arguments. Functions can call other functions, allowing for modular and structured program design.
This document discusses modular programming in C, specifically functions and parameters. It defines functions as blocks of code that perform specific tasks. Functions have components like declarations, definitions, parameters, return values, and scope. Parameters can be passed into functions and different storage classes like auto, static, and extern determine variable lifetime and scope. Functions are useful for code reusability and modularity.
The document discusses functions in C programming. It defines functions as blocks of code that perform a specific task and can be called multiple times. There are two types of functions: user-defined functions created by the programmer, and pre-defined functions that are part of standard libraries. Functions have three aspects - declaration, definition, and call. They can return a value or not, and take arguments or not. Examples are given of different function types. Recursion and string handling functions are also explained.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
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.
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
Low power architecture of logic gates using adiabatic techniquesnooriasukmaningtyas
The growing significance of portable systems to limit power consumption in ultra-large-scale-integration chips of very high density, has recently led to rapid and inventive progresses in low-power design. The most effective technique is adiabatic logic circuit design in energy-efficient hardware. This paper presents two adiabatic approaches for the design of low power circuits, modified positive feedback adiabatic logic (modified PFAL) and the other is direct current diode based positive feedback adiabatic logic (DC-DB PFAL). Logic gates are the preliminary components in any digital circuit design. By improving the performance of basic gates, one can improvise the whole system performance. In this paper proposed circuit design of the low power architecture of OR/NOR, AND/NAND, and XOR/XNOR gates are presented using the said approaches and their results are analyzed for powerdissipation, delay, power-delay-product and rise time and compared with the other adiabatic techniques along with the conventional complementary metal oxide semiconductor (CMOS) designs reported in the literature. It has been found that the designs with DC-DB PFAL technique outperform with the percentage improvement of 65% for NOR gate and 7% for NAND gate and 34% for XNOR gate over the modified PFAL techniques at 10 MHz respectively.
Low power architecture of logic gates using adiabatic techniques
Unit 4 (1)
1. 1
INDEX
Unit-4 CONTENT PAGE NO
Function 2
Definition of function 2
Declaration of function 2
Pass by value 10
Pass by reference 11
Recursion 12
Pointers 14
Definition 17
Initialization 14
Pointers arithmetic 16
Pointers and arrays 19
Example Problems
2. 2
UNIT IV FUNCTIONS AND POINTERS
4.1 Functions
4.1.1. Definition of function
Functions are derived data type. Functions are created when the same process or an
algorithm to be repeated several times in various places in the program. By creating function
the source code is reduced significantly.
Functions are used to give modularity.
The function main () invokes other functions within it. It is the first function to be
called when the program starts execution.
Functions are two types :
Built-in functions
ex: printf, scanf, strcmp etc.
User defined functions.
4.1.2. Initialization of functions
The user-defined function has following characteristics:
1. Return type
2. Function name
3. Parameter list
4. Local variables declaration
5. Statements
6. Return value.
3. 3
returntype function name (argument1,argument 2)
{
local variables; // declaration of the local variables
statements;
return variables;
}
The function with return value must be the data type, that is return type and return
value must be of same data type.
Returning function results
Using the keyword return, followed by data variables.
int add(int a,int b)
{
int c = a+b;
return (c);
}
4. 4
The return Keyword is used only when a function returns a value. If you want to
return more than one values, pointers can be used to directly change the values in address
instead of returning those values to the function.
Calling the function:
Function called by function name followed by parameters.
Function_name();
Function_name(parameters);
Return variable= function_name(parameter);
Parameters
The variables are used in between calling function and called function is called
parameters. There are two types of parameters,
Actual parameter:
The parameters in which are transferred from the calling function to the called
program.
Formal parameter:
The parameters are transferred from the called function to the calling program.
Example:
main()
{
…
fun(parameter1,parameter2);
}
5. 5
fun(parameter3,parameter4);
When declaring a function follows the given points:
The data type should be mention
If there is no parameters passed, mention it as void
The function with return value must be the data type, that is return type
and return value must be of same data type.
The no. of actual parameters & formal parameters must match.
The data type of actual parameters & formal parameters must match.
Example:
#include <stdio.h>
int add ( int x, int y );
int main()
{
int x;
int y;
printf( "Please input two numbers to be multiplied: " );
scanf( "%d", &x );
scanf( "%d", &y );
printf( "The product of your two numbers is %dn", add( x, y ) );
getchar();
}
int add (int x, int y)
{
return x + y;
}
6. 6
Local and global variables
Local:
These variables only exist inside the specific function that creates them. They are unknown
to other functions and to the main program. Local variables cease to exist once the function
that created them is completed.
Global:
These variables can be accessed (ie known) by any function comprising the program. They
are implemented by associating memory locations with variable names. If a variable of the
same name is declared both within a function and outside of it, the function will use the
variable that was declared within it and ignore the global one.
/* Demonstrating global variables */
#include <stdio.h>
int add( void);
int value1, value2, value3;
int add(void)
{
auto int result;
result = value1 + value2 + value3;
return result;
}
int main(void)
{
auto int result;
value1 = 10; value2 = 20; value3 = 30;
result = add();
printf(“The sum of %d + %d + %d is %dn”, value1, value2, value3, result);
7. 7
return 0;
}
Advantage of User defined function:
1. Reduce the source code
2. Easy to maintain and modify
3. It can be called anywhere in the program.
Categories of User defined function:
1. Function without return value and without argument.
2. Function without return value and with argument.
3. Function with return value and with argument.
4. Function with return value and without argument
5. Function with more than one return value
1. Functions with no arguments and no return value.
It is one of the simplest types of function in C. This type of function which does not
return any value cannot be used in an expression it can be used only as independent
statement.
Calling function called function
Void function1()
{
------
Function2();
……
}
Void function2()
{
-----
……
}
No argument passing
No return value
8. 8
A C function without any arguments means you cannot pass data (values like int, char
etc) to the called function. Similarly, function with no return type does not pass back data to
the calling function. Let’s have an example to illustrate this.
In this program , no data transfer takes place between the calling function and the called
function. i.e.. the called program does not receive any data from the calling program and does
not send back any value to the calling program.
#include<stdio.h>
#include<conio.h>
void printline()
{
int i;
printf("n");
for(i=0;i<10;i++)
{
printf(i);
}
printf("n");
}
void main()
{
clrscr();
printf("Welcome");
printline();
getch();
}
9. 9
2. Functions with arguments and no return value.
#include<stdio.h>
#include<conio.h>
void add(int x, int y)
{
int result;
result = x+y;
printf("Sum of %d and %d is %d.nn",x,y,result);
}
void main()
{
clrscr();
add(14,15);
getch();
}
3. Functions with arguments and return value.
Void function1()
{
------
Function2();
……
}
Void function2()
{
-----
……
}
argument passing
No return value
Void function1()
{
------
Res = Function2(10);
……
}
Void function2( int x)
{
-----
Return (z)
}
argument passing
return value
10. 10
#include<stdio.h>
#include<conio.h>
int add(int x, int y)
{
int result;
result = x+y;
return(result);
}
void main()
{
int z;
clrscr();
z = add(9,55);
printf("Result %d.nn",add(30,55));
printf("Result %d.nn",z);
getch();
}
4. Functions with no arguments but returns value.
Void function1()
{
------
Res= Function2();
……
}
Void function2()
{
-----
Return (z)
}
No argument passing
return value
11. 11
#include<stdio.h>
#include<conio.h>
int add()
{
int a;
printf("Enter a no : ");
scanf("%d",&a);
return(a);
}
void main()
{
int z;
clrscr();
z = add();
printf("nYou entered : %d.", z);
getch();
}
5. . Functions that return multiple values.
#include<stdio.h>
#include<conio.h>
void calc(int x, int y, int *add, int *sub)
{
*add = x+y;
*sub = x-y;
}
void main()
{
int a=10, b=11, p,q;
12. 12
clrscr();
calc(a,b,&p,&q);
printf("Sum = %d, Sub = %d",p,q);
getch();
}
4.2. Pass by Value
Pass by Value, means that a copy of the data is made and stored by way of the name
of the parameter. Any changes to the parameter have NO affect on data in the calling
function.
When the value is passed directly to the function it is called call by value. In call by
value only a copy of the variable is only passed so any changes made to the variable does not
reflects in the calling function.
/* ******* call by value ******* */
#include<stdio.h>
#include<conio.h>
swap(int,int);
void main()
{
int x,y;
printf("Enter two nos");
scanf("%d %d",&x,&y);
printf("nBefore swapping : x=%d y=%d",x,y);
swap(x,y);
getch();
}
swap(int a,int b)
{
int t;
13. 13
t=a;
a=b;
b=t;
printf("nAfter swapping :x=%d y=%d",a,b);
}
Enter two nos
15
30
Before swapping :
15
30
After swapping :
30
15
4.3. Pass by Reference
A reference parameter "refers" to the original data in the calling function. Thus any
changes made to the parameter are also made to the original variable.
There are two ways to make a pass by reference parameter:
1. Arrays
2. The ampersand used in the function prototype.
function ( & parameter_name )
#include<stdio.h>
#include<conio.h>
swap(int *, int *);
void main()
{
14. 14
int x,y;
printf("Enter two nos");
scanf("%d %d",&x,&y);
printf("nBefore swapping:x=%d y=%d",x,y);
swap(&x,&y);
printf("nAfter swapping :x=%d y=%d",x,y);
getch();
}
swap(int *a,int *b)
{
int t;
t=*a;
*a=*b;
*b=t;
}
Enter two nos
15
30
Before swapping :
15
30
After swapping :
30
15
Pass by value Pass by reference
This method copies the values of actual
parameters into the formal parameters of the
function.
The process of calling a function using
pointers to pass the addresses of variables is
known as “call by reference”.
15. 15
Here, the changes of the formal parameters
cannot affect the actual parameters, because
formal arguments are photocopy of actual
arguments.
Here, the address of arguments are copied
into the parameters inside the function, the
address is used to access the actual arguments
used in the call. Hence changes made in the
arguments are permanent.
The process of passing the actual value of
variables is known as “call by value”.
4.1.5. Recursion in C:
Recursion is calling function by itself again and again until some specified condition
has been satisfied.
This process is used for repetitive computation in which each action is satisfied in
terms of a previous result.
Syntax:
int functionname (int x)
{
local variables;
functionname(y); // this is recursion
statements;
}
16. 16
Example 1: Factorial using Recursion
#include<stdio.h>
#include<conio.h>
int factorial(int n);
void main()
{
int res,x;
printf(“n Enter the value:”);
scanf(“%d”, &x);
res=factorial(x);
printf(“The factorial of %d is ..%d”, res);
}
int factorial(int n)
{
int fact;
if (n==1)
return(1);
else
fact = n*factorial(n-1);
return(fact);
}
Factorial of 5 is 120
i.e., 5 * factorial(5-1)
5 * 4*factorial(4-1)
5 * 4*3*factorial(3-1)
5 * 4*3*2* factorial(2-1)
5 * 4*3*2*1*factorial(1-1)
5*4*3*2*1
17. 17
Example 2: Fibonacci using Recursion
#include<stdio.h>
#include<conio.h>
int Fibonacci(int);
int main()
{
int n,c;
scanf("%d",&n);
printf("Fibonacci seriesn");
for ( c = 1 ; c <= n ; c++ )
{
printf("%dn", Fibonacci(c));
c++;
}
return 0;
}
int Fibonacci(int n)
{
if ( n == 0 )
return 0;
else if ( n == 1 )
return 1;
else
return ( Fibonacci(n-1) + Fibonacci(n-2) );
}
Similarly , recursion of Fibonacci series takes in to another way:
#include <stdio.h>
18. 18
int fibonaci(int i)
{
if(i == 0)
{
return 0;
}
if(i == 1)
{
return 1;
}
return fibonaci(i-1) + fibonaci(i-2);
}
int main()
{
int i;
for (i = 0; i < 10; i++)
{
printf("%dt%n", fibonaci(i));
}
return 0;
}
Example: 3
/* To find sum of first n natural numbers using recursion.*/
#include <stdio.h>
int sum(int n);
int main(){
int n,add;
printf("Enter a positive natural integer:n");
scanf("%d",&n);
add=sum(n);
19. 19
printf("sum=%d",add);
}
int sum(int n){
if(n==0)
return n;
else
return n+sum(n-1);
}
=3+sum(2)
=3+2+sum(1)
=3+2+1+sum(0)
=3+2+1+0
=6
Command line arguments
main() function of a C program accepts arguments from command line or from other shell
scripts by following commands.
They are,
argc
argv[]
where,
argc - Number of arguments in the command line including program name
argv[] – This is carrying all the arguments
20. 20
ex:
>prg1 hello hai
argc = 4
argv[0] = “prg1”
argv[1] = “hello”
argv[2] = “hai”
argv[3] = NULL
ex: program for command line arguments
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) // command line arguments
{
printf("n Program name : %s n", argv[0]);
return 0;
}
4.2. Pointers
Normal variable stores the value whereas pointer variable stores the address of the
variable. The content of the C pointer always be a whole number i.e. address.
A pointer is a variable and contains the address of another variable. It is denoted
by ‘*’ operator. Pointers are called “address variable”.
The indirection operators (*) returns the value of the address stored in a pointer. The
address of operator (&) returns the memory address of the variable.
21. 21
Pointer is a user defined data type which creates special types of variables which
can hold the address of primitive data type like char, int, float, double or user defined data
type like function, pointer etc. or derived data type like array, structure, union, enum.
Null pointer:
A pointer is said to be a null pointer when its right side value is 0.
It can never point valid data.
It is assigned to 0, so it is a null pointer and is not valid.
int *a;
int *b;
b=a=0;
a and b become null pointers
Pointer to pointer
A variable that is a pointer to a pointer must be declared using additional indirection
operator symbols in front of the name.
int ** p;
Pointer is a variable that contains the address of the another variable.
Example
int a=5;
int *b;
int **c;
b=&a;
c=&b;
Display array with addresses:
22. 22
#include<stdio.h>
#include<stdlib.h>
int main() {
int a[3] = { 10, 20, 30 };
printf("n a[0] ,value=%d : address=%u", a[0], &a[0]);
printf("n a[1] ,value=%d : address=%u", a[1], &a[1]);
printf("n a[2] ,value=%d : address=%u", a[2], &a[2]);
return (0);
}
Advantages
Pointers are used for efficient code.
Pointers are access memory efficiently and simplicity.
Difference between arrays and pointers are as follows.
Array Pointer
Array allocates space automatically Pointer is explicitly assigned to point to an
allocated
space.
It cannot be resized. It can be resized using realloc ().
It cannot be reassigned. Pointers can be reassigned.
Size of(array name) gives the number of
bytes occupied by the array.
Sizeof(pointer name) returns the number of
bytes used to store the pointer variable
23. 23
4.2.1. Pointer –Initialization:
Assigning value to pointer:
Only zero (0) and NULL can be assigned to a pointer no other number can be
assigned to a pointer.
Consider the following examples;
int *p=0;
int *p=NULL;
int *p = null.
The value of null pointer is 0. If pointer is assigned to NULL, it means it is pointing to
nothing. The size of any pointer is 2 byte (for 16 bit compiler).
Assigning variable to a pointer:
int a; *p;
p = &a;
A pointer variable p is assigned the address of the variable a. The address of the variables will
be different every time.
& symbol is used to get the address of the variable.
* symbol is used to get the value of the variable.
About variable a:
1. Name of variable : a
2. Value of variable which it keeps: 5
3. Address where it has stored in memory : 1025 (assume)
About variable ptr:
24. 24
1. Name of variable : ptr
2. Value of variable which it keeps: 1025
3. Address where it has stored in memory : 5000 (assume)
/* accessing variable thru pointer */
#include <stdio.h>
main ()
{
int age=39;
printf(“address of age =%u’’ ,&age)
printf(“value of age =%d’’ , age)
}
Output
Address of age =265432
Value of age =39
We are going to add two numbers by using pointer.
/* add two numbers using pointer */
#include<stdio.h>
int main() {
int *ptr1, *ptr2;
int num;
printf("nEnter two numbers : ");
scanf("%d %d", ptr1, ptr2);
25. 25
num = *ptr1 + *ptr2;
printf("Sum = %d", num);
return (0);
}
4.2.2. Pointer Arithmetic
Rule 1: Addition arithmetic with pointers
Address + Number= Address
Address - Number= Address
Address++ = Address
Address-- = Address
++Address = Address
--Address = Address
If we will add or subtract a number from an address result will also be an address.
New address will be:
New address = old address + number*size of data type which pointer is pointing
Or
New address = old address - number*size of data type which pointer is pointing
Example:
#include<stdio.h>
int main()
{
int *ptr=( int *)1000;
26. 26
ptr=ptr+1;
printf(" %u",ptr);
return 0;
}
Output: 1002
Rule 2: Difference arithmetic with pointers
Address - Address=Number
If you will subtract two pointers result will be a number but number will not simple
mathematical subtraction of two addresses but it follow following rule:
If two pointers are of same type then:
Address2 –address1 = subtraction of two address/size of data type which pointer points
Example:
Explanation:
Here two pointer p and temp are of same type and both are pointing to int data type varaible.
p-temp = (1004-1000)/sizeof(int)
=4/2
=2
#include<stdio.h>
int main()
{
int *p=(int *)1000;
27. 27
int *temp;
temp=p;
p=p+2;
printf("%u %un",temp,p);
printf("difference= %d",p-temp);
return 0;
}
Output: 1000 1004
Difference= 2
Pointer to function
Function pointer definition: A pointer which keeps address of a function is known as
function pointer
Example:
#include<stdio.h>
int * function();
int main(){
auto int *x;
int *(*ptr)();
ptr=&function;
x=(*ptr)();
printf("%d",*x);
return 0;
}
int *function(){
static int a=10;
return &a;
}
28. 28
Output: 10
Here function is function whose parameter is void data type and return type is pointer to int
data type.
x=(*ptr)()
x=(*&functyion)() //ptr=&function
x=function() //From rule *&p=p
x=&a
So, *x = *&a = a =10
Pointer to structure:
A pointer which is pointing to a structure is known as pointer to structure.
Example:
#include<stdio.h>
struct address
{
char *name;
char street[10];
int pin;
} cus;
cus={"pandi","H",625003},*p=&cus;
int main()
{
printf("%s %s",p->name,(*p).street);
return 0;
}
• p is pointer to structure address.
29. 29
• -> and (*). Both are same thing. These operators are used to access data member of
structure by using structure’s pointer.
Output: pandi H
Pointer to union:
Pointer to union: A pointer which is pointing to a union is know as pointer to union
Example:
#include<stdio.h>
union address{
char *name;
char street[10];
int pin;
};
int main(){
union address emp,*p;
emp.name="jai";
p=&emp;
printf("%s %s",p->name,(*p).name);
return 0;
}
• p is pointer to union address.
• -> and (*). Both are same thing. These operators are used to access data member of
union by using union’s pointer.
• %s is used to print the string up to null character i.e. ‘0’
Output: jai
4.2.4. Pointer to array
30. 30
Here an array is declared, the memory should be allocated in contiguous location. The
memory location as a base address plus sufficient amount of storage .
base address = location of the first element (index 0) of the array.
farray [][3];
It is two dimension array and its content are float constants. array [3]:It is one
dimension array and its content are address of such one dimension array which content are
float constant. ptr: It is pointer to one dimension array which content are address of such one
dimension array which content are float constant.
Example:
#include<stdio.h>
int main(){
static float farray[][3]={0.0f,1.0f,2.0f,3.0f,4.0f,5.0f,6.0f,7.0f,8.0f};
float (*array[3])[3]={&farray[0],&farray[1],&farray[2]};
float (*(*ptr)[])[3]=&array;
printf("%f ",2[(*(**ptr+1))]);
return 0;
}
Output: 5.000000
Pointer to array of character:
A pointer to such an array which contents is character constants is known as pointer to
array of character constant.
Example:
#include<stdio.h>
char display(char (*)[]);
31. 31
int main(){
char c;
char character[]={65,66,67,68};
char (*ptr)[]=&character;
c=display(ptr);
printf("%c",c);
return 0;
}
char display(char (*s)[]){
**s+=2;
return **s;
}
Output: C
Here function display is passing pointer to array of characters and returning char data type.
**s+=2
=>**s=**s+2
=>**ptr=**ptr+2 //s=ptr
=>**&character= **&character+2 //ptr=&character
=>*character=*character+2 //from rule *&p =p
=>character[0]=character[0]+2 //from rule *(p+i)=p[i]
=>character [0] =67
**s=character [0] =67
Note: ASCII value of ‘C’ is 67
When an array name is passed to a function, what is passed is the location of the
initial element. Within the called function, this argument is a local variable, and so an array
32. 32
name parameter is a pointer, that is, a variable containing an address. We can use this fact to
write another version of strlen, which computes the length of a string.
/* strlen: return length of string s */
int strlen(char *s)
{
int n;
for (n = 0; *s != '0', s++)
n++;
return n;
}
Since s is a pointer, incrementing it is perfectly legal; s++ has no effect on the character
string in the function.
Pointer to array of integers:
A pointer to such an array which contents are integer numbers is known as pointer to
array of integer.
#include<stdio.h>
int main()
{
static int i,j,k;
int *(*ptr)[];
int *array[3]={&i,&j,&k};
ptr=&array;
j=i+++k+10;
++(**ptr);
printf("%d",***ptr);
return 0;
}
Output: 10
33. 33
Note: In the above figure upper part of box represent content and lower part represent
memory address. We have assumed arbitrary address.
j=i+++k+10
=i++ + k+10
=0 +0 +10=10
***ptr = *** (&array) //ptr=&array
= **array //From rule *&p=p
//From rule array [0] =*(array+0) and ++ (**ptr)
=*array [1]
=*&j
=j
=10