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.
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
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
Call by value or call by reference in C++Sachin Yadav
Call by value means passing the value directly to a function. The called function uses the value in a local variable; any changes to it DO NOT affect the source variable. In call by value method, the called function creates its own copies of original values sent to it. Any changes, that are made, occur on the function’s copy of values and are not reflected back to the calling function.
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.
The ppt describes usage of functions in c language. Showing basic use of function and determining the differences between function call by value and function call by reference using pointer. It also includes valid use in swapping two numbers in c along with different outputs. Overall its a basic note for c language.
Call by value or call by reference in C++Sachin Yadav
Call by value means passing the value directly to a function. The called function uses the value in a local variable; any changes to it DO NOT affect the source variable. In call by value method, the called function creates its own copies of original values sent to it. Any changes, that are made, occur on the function’s copy of values and are not reflected back to the calling function.
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.
The ppt describes usage of functions in c language. Showing basic use of function and determining the differences between function call by value and function call by reference using pointer. It also includes valid use in swapping two numbers in c along with different outputs. Overall its a basic note for c language.
This is continuation of the slide Advanced C part 1. In part 1 you learnt about fundamentals of C - How to build an algorithm, operators. In this module - Advanced C part 2 you will be learning about functions, pointers and standard Input Output functions. This slide will help you to move a further ahead in Advanced C and gain deeper knowledge on it.
Programming Fundamentals Functions in C and typesimtiazalijoono
Programming Fundamentals
Functions in C
Lecture Outline
• Functions
• Function declaration
• Function call
• Function definition
– Passing arguments to function
1) Passing constants
2) Passing variables
– Pass by value
– Returning values from functions
• Preprocessor directives
• Local and external variables
Introduction User Defined Functions in C,
Categories of Functions,Call by Value,
Call by Reference,Actual arguments,Formal arguments ,Direct Recursive and
Indirect Recursive functions
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Epistemic Interaction - tuning interfaces to provide information for AI support
functions
1. Outline
Introduction
Program Modules in C
Math Library Functions
Functions
Function Definitions
Function Prototypes
Header Files
Calling Functions: Call by Value and Call by
Reference
Random Number Generation
Recursion
Example Using Recursion: The Fibonacci Series
Recursion vs. Iteration
2. Divide and conquer
◦ Construct a program from smaller pieces or
components
◦ Each piece more manageable than the original
program
3. Functions
◦ Modules in C
◦ Programs written by combining user-defined functions with
library functions
C standard library has a wide variety of functions
Makes programmer's job easier - avoid reinventing the wheel
4. Function calls
◦ Invoking functions
Provide function name and arguments (data)
Function performs operations or manipulations
Function returns results
◦ Boss asks worker to complete task
Worker gets information, does task, returns result
Information hiding: boss does not know details
5. Math library functions
◦ perform common mathematical calculations
◦ #include <math.h>
Format for calling functions
FunctionName (argument);
If multiple arguments, use comma-separated list
◦ printf( "%.2f", sqrt( 900.0 ) );
Calls function sqrt, which returns the square root of its
argument
All math functions return data type double
◦ Arguments may be constants, variables, or
expressions
6. Functions
◦ Modularize a program
◦ All variables declared inside functions are local variables
Known only in function defined
◦ Parameters
Communicate information between functions
Local variables
Benefits
◦ Divide and conquer
Manageable program development
◦ Software reusability
Use existing functions as building blocks for new programs
Abstraction - hide internal details (library functions)
◦ Avoids code repetition
7. Function definition format
return-value-type function-name( parameter-list )
{
declarations and statements
}
◦ Function-name: any valid identifier
◦ Return-value-type: data type of the result (default int)
void - function returns nothing
◦ Parameter-list: comma separated list, declares
parameters (default int)
8. Function definition format (continued)
return-value-type function-name( parameter-list )
{
declarations and statements
}
◦ Declarations and statements: function body (block)
Variables can be declared inside blocks (can be nested)
Function can not be defined inside another function
◦ Returning control
If nothing returned
return;
or, until reaches right brace
If something returned
return expression;
9. 1. Function prototype
(3 parameters)
2. Input values
2.1 Call function
3. Function definition
Program Output
1 /* Fig. 5.4: fig05_04.c
2 Finding the maximum of three integers */
3 #include <stdio.h>
4
5 int maximum( int, int, int ); /* function prototype */
6
7 int main()
8 {
9 int a, b, c;
10
11 printf( "Enter three integers: " );
12 scanf( "%d%d%d", &a, &b, &c );
13 printf( "Maximum is: %dn", maximum( a, b, c ) );
14
15 return 0;
16 }
17
18 /* Function maximum definition */
19 int maximum( int x, int y, int z )
20 {
21 int max = x;
22
23 if ( y > max )
24 max = y;
25
26 if ( z > max )
27 max = z;
28
29 return max;
30 }
Enter three integers: 22 85 17
Maximum is: 85
10. Function prototype
◦ Function name
◦ Parameters - what the function takes in
◦ Return type - data type function returns (default int)
◦ Used to validate functions
◦ Prototype only needed if function definition comes after use in
program
int maximum( int, int, int );
Takes in 3 ints
Returns an int
Promotion rules and conversions
◦ Converting to lower types can lead to errors
11. Header files
◦ contain function prototypes for library functions
◦ <stdlib.h> , <math.h> , etc
◦ Load with #include <filename>
#include <math.h>
Custom header files
◦ Create file with functions
◦ Save as filename.h
◦ Load in other files with #include "filename.h"
◦ Reuse functions
12. Used when invoking functions
Call by value
◦ Copy of argument passed to function
◦ Changes in function do not effect original
◦ Use when function does not need to modify argument
Avoids accidental changes
Call by reference
◦ Passes original argument
◦ Changes in function effect original
◦ Only used with trusted functions
For now, we focus on call by value
13. rand function
◦ Load <stdlib.h>
◦ Returns "random" number between 0 and RAND_MAX (at least
32767)
i = rand();
◦ Pseudorandom
Preset sequence of "random" numbers
Same sequence for every function call
Scaling
◦ To get a random number between 1 and n
1 + ( rand() % n )
rand % n returns a number between 0 and n-1
Add 1 to make random number between 1 and n
1 + ( rand() % 6) // number between 1 and 6
14. srand function
◦ <stdlib.h>
◦ Takes an integer seed - jumps to location in "random"
sequence
srand( seed );
◦ srand( time( NULL ) ); //load <time.h>
time( NULL )- time program was compiled in seconds
"randomizes" the seed
15. Recursive functions
◦ Function that calls itself
◦ Can only solve a base case
◦ Divides up problem into
What it can do
What it cannot do - resembles original problem
Launches a new copy of itself (recursion step)
Eventually base case gets solved
◦ Gets plugged in, works its way up and solves whole
problem
17. Fibonacci series: 0, 1, 1, 2, 3, 5, 8...
◦ Each number sum of the previous two
fib(n) = fib(n-1) + fib(n-2) - recursive
formula
long fibonacci(long n)
{
if (n==0 || n==1) //base case
return n;
else return fibonacci(n-1) + fibonacci(n-2);
}
19. 1. Function prototype
1.1 Initialize variables
2. Input an integer
2.1 Call function
fibonacci
2.2 Output results.
3. Define fibonacci
recursively
Program Output
1 /* Fig. 5.15: fig05_15.c
2 Recursive fibonacci function */
3 #include <stdio.h>
4
5 long fibonacci( long );
6
7 int main()
8 {
9 long result, number;
10
11 printf( "Enter an integer: " );
12 scanf( "%ld", &number );
13 result = fibonacci( number );
14 printf( "Fibonacci( %ld ) = %ldn", number, result );
15 return 0;
16 }
17
18 /* Recursive definition of function fibonacci */
19 long fibonacci( long n )
20 {
21 if ( n == 0 || n == 1 )
22 return n;
23 else
24 return fibonacci( n - 1 ) + fibonacci( n - 2 );
25 }
Enter an integer: 0
Fibonacci(0) = 0
Enter an integer: 1
Fibonacci(1) = 1
20. Program Output
Enter an integer: 2
Fibonacci(2) = 1
Enter an integer: 3
Fibonacci(3) = 2
Enter an integer: 4
Fibonacci(4) = 3
Enter an integer: 5
Fibonacci(5) = 5
Enter an integer: 6
Fibonacci(6) = 8
Enter an integer: 10
Fibonacci(10) = 55
Enter an integer: 20
Fibonacci(20) = 6765
Enter an integer: 30
Fibonacci(30) = 832040
Enter an integer: 35
Fibonacci(35) = 9227465
21. Repetition
◦ Iteration: explicit loop
◦ Recursion: repeated function calls
Termination
◦ Iteration: loop condition fails
◦ Recursion: base case recognized
Both can have infinite loops
Balance
◦ Choice between performance (iteration) and good software engineering
(recursion)