The document discusses functions in C programming. It covers defining and calling functions, passing arguments to functions, return statements, and different types of functions. Some key points include:
- Functions make code modular and reusable. Arguments can be passed by value or reference.
- A function is defined with a return type, name, and parameters. It is called by name with arguments. Return passes data back to the calling function.
- Functions can take arguments and return values, take arguments but not return, return values without arguments, or do neither.
- Arguments are passed right to left in C. Functions can be nested by calling one function from another.
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 presentation covers very frequently used standard library functions also called as inbuilt functions. a brief description about function and its declaration (syntax) is defined for help.
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.
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.
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 presentation covers very frequently used standard library functions also called as inbuilt functions. a brief description about function and its declaration (syntax) is defined for help.
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.
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.
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
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
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...BBPMedia1
Grote partijen zijn al een tijdje onderweg met retail media. Ondertussen worden in dit domein ook de kansen zichtbaar voor andere spelers in de markt. Maar met die kansen ontstaan ook vragen: Zelf retail media worden of erop adverteren? In welke fase van de funnel past het en hoe integreer je het in een mediaplan? Wat is nu precies het verschil met marketplaces en Programmatic ads? In dit half uur beslechten we de dilemma's en krijg je antwoorden op wanneer het voor jou tijd is om de volgende stap te zetten.
Falcon stands out as a top-tier P2P Invoice Discounting platform in India, bridging esteemed blue-chip companies and eager investors. Our goal is to transform the investment landscape in India by establishing a comprehensive destination for borrowers and investors with diverse profiles and needs, all while minimizing risk. What sets Falcon apart is the elimination of intermediaries such as commercial banks and depository institutions, allowing investors to enjoy higher yields.
Putting the SPARK into Virtual Training.pptxCynthia Clay
This 60-minute webinar, sponsored by Adobe, was delivered for the Training Mag Network. It explored the five elements of SPARK: Storytelling, Purpose, Action, Relationships, and Kudos. Knowing how to tell a well-structured story is key to building long-term memory. Stating a clear purpose that doesn't take away from the discovery learning process is critical. Ensuring that people move from theory to practical application is imperative. Creating strong social learning is the key to commitment and engagement. Validating and affirming participants' comments is the way to create a positive learning environment.
LA HUG - Video Testimonials with Chynna Morgan - June 2024Lital Barkan
Have you ever heard that user-generated content or video testimonials can take your brand to the next level? We will explore how you can effectively use video testimonials to leverage and boost your sales, content strategy, and increase your CRM data.🤯
We will dig deeper into:
1. How to capture video testimonials that convert from your audience 🎥
2. How to leverage your testimonials to boost your sales 💲
3. How you can capture more CRM data to understand your audience better through video testimonials. 📊
3.0 Project 2_ Developing My Brand Identity Kit.pptxtanyjahb
A personal brand exploration presentation summarizes an individual's unique qualities and goals, covering strengths, values, passions, and target audience. It helps individuals understand what makes them stand out, their desired image, and how they aim to achieve it.
Memorandum Of Association Constitution of Company.pptseri bangash
www.seribangash.com
A Memorandum of Association (MOA) is a legal document that outlines the fundamental principles and objectives upon which a company operates. It serves as the company's charter or constitution and defines the scope of its activities. Here's a detailed note on the MOA:
Contents of Memorandum of Association:
Name Clause: This clause states the name of the company, which should end with words like "Limited" or "Ltd." for a public limited company and "Private Limited" or "Pvt. Ltd." for a private limited company.
https://seribangash.com/article-of-association-is-legal-doc-of-company/
Registered Office Clause: It specifies the location where the company's registered office is situated. This office is where all official communications and notices are sent.
Objective Clause: This clause delineates the main objectives for which the company is formed. It's important to define these objectives clearly, as the company cannot undertake activities beyond those mentioned in this clause.
www.seribangash.com
Liability Clause: It outlines the extent of liability of the company's members. In the case of companies limited by shares, the liability of members is limited to the amount unpaid on their shares. For companies limited by guarantee, members' liability is limited to the amount they undertake to contribute if the company is wound up.
https://seribangash.com/promotors-is-person-conceived-formation-company/
Capital Clause: This clause specifies the authorized capital of the company, i.e., the maximum amount of share capital the company is authorized to issue. It also mentions the division of this capital into shares and their respective nominal value.
Association Clause: It simply states that the subscribers wish to form a company and agree to become members of it, in accordance with the terms of the MOA.
Importance of Memorandum of Association:
Legal Requirement: The MOA is a legal requirement for the formation of a company. It must be filed with the Registrar of Companies during the incorporation process.
Constitutional Document: It serves as the company's constitutional document, defining its scope, powers, and limitations.
Protection of Members: It protects the interests of the company's members by clearly defining the objectives and limiting their liability.
External Communication: It provides clarity to external parties, such as investors, creditors, and regulatory authorities, regarding the company's objectives and powers.
https://seribangash.com/difference-public-and-private-company-law/
Binding Authority: The company and its members are bound by the provisions of the MOA. Any action taken beyond its scope may be considered ultra vires (beyond the powers) of the company and therefore void.
Amendment of MOA:
While the MOA lays down the company's fundamental principles, it is not entirely immutable. It can be amended, but only under specific circumstances and in compliance with legal procedures. Amendments typically require shareholder
Kseniya Leshchenko: Shared development support service model as the way to ma...Lviv Startup Club
Kseniya Leshchenko: Shared development support service model as the way to make small projects with small budgets profitable for the company (UA)
Kyiv PMDay 2024 Summer
Website – www.pmday.org
Youtube – https://www.youtube.com/startuplviv
FB – https://www.facebook.com/pmdayconference
"𝑩𝑬𝑮𝑼𝑵 𝑾𝑰𝑻𝑯 𝑻𝑱 𝑰𝑺 𝑯𝑨𝑳𝑭 𝑫𝑶𝑵𝑬"
𝐓𝐉 𝐂𝐨𝐦𝐬 (𝐓𝐉 𝐂𝐨𝐦𝐦𝐮𝐧𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬) is a professional event agency that includes experts in the event-organizing market in Vietnam, Korea, and ASEAN countries. We provide unlimited types of events from Music concerts, Fan meetings, and Culture festivals to Corporate events, Internal company events, Golf tournaments, MICE events, and Exhibitions.
𝐓𝐉 𝐂𝐨𝐦𝐬 provides unlimited package services including such as Event organizing, Event planning, Event production, Manpower, PR marketing, Design 2D/3D, VIP protocols, Interpreter agency, etc.
Sports events - Golf competitions/billiards competitions/company sports events: dynamic and challenging
⭐ 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐝 𝐩𝐫𝐨𝐣𝐞𝐜𝐭𝐬:
➢ 2024 BAEKHYUN [Lonsdaleite] IN HO CHI MINH
➢ SUPER JUNIOR-L.S.S. THE SHOW : Th3ee Guys in HO CHI MINH
➢FreenBecky 1st Fan Meeting in Vietnam
➢CHILDREN ART EXHIBITION 2024: BEYOND BARRIERS
➢ WOW K-Music Festival 2023
➢ Winner [CROSS] Tour in HCM
➢ Super Show 9 in HCM with Super Junior
➢ HCMC - Gyeongsangbuk-do Culture and Tourism Festival
➢ Korean Vietnam Partnership - Fair with LG
➢ Korean President visits Samsung Electronics R&D Center
➢ Vietnam Food Expo with Lotte Wellfood
"𝐄𝐯𝐞𝐫𝐲 𝐞𝐯𝐞𝐧𝐭 𝐢𝐬 𝐚 𝐬𝐭𝐨𝐫𝐲, 𝐚 𝐬𝐩𝐞𝐜𝐢𝐚𝐥 𝐣𝐨𝐮𝐫𝐧𝐞𝐲. 𝐖𝐞 𝐚𝐥𝐰𝐚𝐲𝐬 𝐛𝐞𝐥𝐢𝐞𝐯𝐞 𝐭𝐡𝐚𝐭 𝐬𝐡𝐨𝐫𝐭𝐥𝐲 𝐲𝐨𝐮 𝐰𝐢𝐥𝐥 𝐛𝐞 𝐚 𝐩𝐚𝐫𝐭 𝐨𝐟 𝐨𝐮𝐫 𝐬𝐭𝐨𝐫𝐢𝐞𝐬."
Unveiling the Secrets How Does Generative AI Work.pdfSam H
At its core, generative artificial intelligence relies on the concept of generative models, which serve as engines that churn out entirely new data resembling their training data. It is like a sculptor who has studied so many forms found in nature and then uses this knowledge to create sculptures from his imagination that have never been seen before anywhere else. If taken to cyberspace, gans work almost the same way.
What are the main advantages of using HR recruiter services.pdfHumanResourceDimensi1
HR recruiter services offer top talents to companies according to their specific needs. They handle all recruitment tasks from job posting to onboarding and help companies concentrate on their business growth. With their expertise and years of experience, they streamline the hiring process and save time and resources for the company.
3. Advantages :
Program writing becomes easy
Program becomes easy to understand
Modification in large program becomes easy
Modularity comes in program when we use function
08/23/153
4. Calling to a function.
message();
main( )
{
message( ) ;
printf ( "nHello!" ) ;
}
message( )
{
printf ( "nJUET..." ) ;
}
And here’s the output...
JUET
Hello! 08/23/154
5. Calling to a function(Cont…)
When main function calls message() the control passes to the
function message( ). The activity of main( ) is temporarily
suspended; it falls asleep while the message( ) function wakes up and
goes to work. When the message( ) function runs out of statements
to execute, the control returns to main( ), which comes to life again
and begins executing its code at the exact point where it left off.
Thus, main( ) becomes the ‘calling’ function, whereas message( )
becomes the ‘called’ function.
08/23/155
6. Cont…
main( )
{
printf ( "nI am in main" ) ;
italy( ) ;
brazil( ) ;
argentina( ) ;
}
italy( ){
printf ( "nI am in italy" ) ;
}
brazil( ){
printf ( "nI am in brazil" ) ;
}
argentina( ){
printf ( "nI am in argentina" ) ;
}
08/23/156
I am in main
I am in italy
I am in brazil
I am in argentina
7. Function Declaration
Declaration Syntax:
Return_Type Function_Name(argument_list);
Return_Type can be any of data type like char, int, float, double,
array, pointer etc.
argument_list can also be any of data type like char, int, float,
double, array, pointer etc.
Declaration must be before the call of function in main
function
Example: int add(int a, int b);
08/23/157
10. Sample Example
#include<stdio.h>
int sum (int,int); //function declaration
void main(){
int p;
p=sum(3,4); //function call
printf(“%d”,p);
}
int sum( int a,int b){
int s; //function body
s=a+b;
return s; //function returning a value
} 08/23/1510
11. Passing arguments to functions
In programming, argument(parameter) refers to data that is
passed to function(function definition) while calling function.
In following example two variable, num1 and num2 are passed to
function during function call and these arguments are accepted by
arguments a and b in function definition.
08/23/1511
12. Cont…
Formal Parameter :Parameter written in Function Definition is Called “Formal
Parameter”.
In last example a and b are formal parameters.
There are two methods of declaring the formal arguments.
1. Kernighan and Ritchie (or just K & R) method.
calsum ( x, y, z )
int x, y, z ;
2. ANSI method
calsum ( int x, int y, int z )
This method is called ANSI method and is more commonlyused these days.
Actual Parameter :Parameter written in Function Call is Called “Actual
Parameter”.
In last example num1 and num2 were actual parameters. 08/23/1512
13. Example: parameter passing
/* Sending and receiving values between functions */
main( ){
int a, b, c, sum ;
printf ( "nEnter any three numbers " ) ;
scanf ( "%d %d %d", &a, &b, &c ) ;
sum = calsum ( a, b, c ) ;
printf ( "nSum = %d", sum ) ;
}
calsum ( x, y, z )
int x, y, z ;
{
int d ;
d = x + y + z ;
return ( d ) ;
}
And here is the output...
Enter any three numbers 10 20 30
Sum = 60 08/23/1513
14. Return statement
In the message() function of previous example the moment closing
brace ( } ) of the called function was encountered the control returned
to the calling function. No separate return statement was necessary to
send back the control.
This approach is fine if the called function is not going to return any
meaningful value to the calling function.
In the above program, however, we want to return the sum of x, y
and z. Therefore, it is necessary to use the return statement.
The return statement serves two purposes:
(1) On executing the return statement it immediately transfers the control back to the
calling program.
(2) It returns the value present in the parentheses after return, to the calling function.
In the above program the value of sum of three numbers is being returned.
08/23/1514
15. Return statement(Cont…)
There is no restriction on the number of return statements that may be present in a
function. Also, the return statement need not always be present at the end of the
called function.
The following program illustrates these facts.
fun( ){
char ch ;
printf ( "nEnter any alphabet " ) ;
scanf ( "%c", &ch ) ;
if ( ch >= 65 && ch <= 90 )
return ( ch ) ;
else
return ( ch + 32 ) ;
}
In this function different return statements will be executed depending on whether
ch is capital or not.
08/23/1515
16. Return statement(Cont…)
If a meaningful value is returned then it should be accepted in the calling program by
equating the called function to some variable. For example,
sum = calsum ( a, b, c ) ;
All the following are valid return statements.
return ( a ) ;
return ( 23 ) ;
return ( 12.34 ) ;
return ;
A function can return only one value at a time. Thus, the following statements are
invalid.
return ( a, b ) ;//this will return value of b
return ( x, 12 ) ;
There is a way to get around this limitation, which would be discussed later when we
learn pointers.
08/23/1516
17. Calling Convention
Calling convention indicates the order in which arguments are
passed to a function when a function call is encountered. There
are two possibilities here:
(a) Arguments might be passed from left to right.
(b) Arguments might be passed from right to left.
C language follows the second order.
Consider the following function call:
fun (a, b, c, d ) ;
In this call it doesn’t matter whether the arguments are passed
from left to right or from right to left.
08/23/1517
19. Ways to Pass Parameters
Call By Value:In this approach we pass copy of actual variables
in function as a parameter.
Hence any modification on parameters inside the function will not
reflect in the actual variable.
08/23/1519
20. Ways to Pass
Parameters(Cont..)
Call By Reference:In this approach we pass memory address of
actual variables in function as a parameter.
Hence any modification on parameters inside the function will
reflect in the actual variable.
08/23/1520
21. Swap two variables without using a
third variable
#include<stdio.h>
void swap(int *,int *);
void main(){
int a=5,b=10;
swap(&a,&b);
printf("%d %d",a,b);
}
void swap(int *a,int *b){
*a=*a+*b;
*b=*a-*b;
*a=*a-*b;
}
22. Types of Function
1st :Take something and Return something (Function
with return value and parameters)
Example: printf, scanf , strlen, strcmp etc.
2nd : Take something and Return nothing (Function
with no return value but parameters)
Example: delay,
3rd : Take nothing and return something (Function with
return value but no parameter)
Example: getch,
4th : Take nothing and return nothing (Function with
no return value and no parameter)
Example: clrscr,
08/23/1522
27. Nesting of function call
If we are calling any function inside another function call is known as nesting
function call.
Sometime it converts a difficult program in easy one.
For example 1:
int max(int x,int y){
return x>y?x:y;
}
int fact(int);
void main(){
int a,b,c;
scanf(“%d%d”,&a,&b);
c=fact(max(a,b));
print(“factorial of %d is %d”,max(a,b),c);
}
08/23/1527
int fact(int a)
{
int fact=1;
while(a>0)
{
fact=fact*a;
a--;
}
return fact;
}
O/P:6
7
factorial of 7 is 5040
29. Problem
Write a function which receives a float and an int from
main( ), finds the product of these two and returns the
product which is printed through main( ).
08/23/1529