SlideShare a Scribd company logo
1 of 21
Download to read offline
MANSI TYAGI
FUNCTION
De_nition
 A’C’ program consists of one or more functions.
 Every program must contain atleast one function named as main( ),
where the program always begins execution.
 Functions are normally used to divide a large program into smaller
programs which are easier to handle.
 Function after its execution returns a single value.
Need of Functions :of Function
Several advantages of modularizing a program into function includes:
 Reduction in code redundancy
 Enabling code reuse
 Better readability
 Information Hiding
 Improved debugging and testing
 Improved maintainability
Abhineet
A function is a self contained block of codes or sub programs with a set of
statements that perform some specific task or coherent task.
MANSI TYAGI
There are basically two types of function those are:
1. Library function
2. User defined function
1. Library /Built in /Standard function :
These functions that are inbuilt in the C language compiler are library
functions i.e: printf() and scanf() belongs to the category of library
functions.
 These functions are present in C library and they are
predefined.
For ex: printf(),scanf(),getch(),clrscr(),main().
2. User defined function :
These functions that are defined by the user according to its requirement
at the time of writing the program.
 User can create their own functions for performing any
specific task of the program.These types of functions are
called user-defined functions.
 There are three aspect of working with user-defined
functions:
1. Function Declaration, also known as function prototype
2. Function Definition
3. Function Call or function invocation
MANSI TYAGI
Syntax:-
Return type function name (argument list )
Return type name of function (type 1 arg 1, type2 arg2, type3 arg3)
 So when user gets his own function three thing he has to know, these
are.
Function declaration
Function definition
Function call
These three things are represented like :
int function(int, int, int); /*function declaration*/
main()
{
function(arg1,arg2,arg3); /* calling function*/
}
int function(type 1 arg 1,type2 arg2,type3, arg3) /*function definition/*
{
Local variable declaration;
Statement;
Return value;
}
 Function declaration:-
Function declaration is also known as function prototype. It inform the compiler
about three thing, those are name of the function, and type of argument
received by the function and the type of value returned by the function.
 Function prototype always terminated by the semicolon.
Syntax:
Type function_name(parameter list);
int function(int, int, int); /*function declaration*
Ex- int add(int x,int y);
MANSI TYAGI
 Function definition:-
Function definition consists of the whole description and code of the function.
It tells about what function is doing what are its inputs and what are its out put
It consists of two parts function header and function body.
Syntax:-
return type function(type 1 arg1, type2 arg2, type3 arg3) /*function header*/
{
Local variable declaration;
Statement 1;
Statement 2; /*function body*/
Return value;
}
 The local variable declared inside a function is local to that function only. It
can’t be used anywhere in the program and its existence is only within this
function.
 The arguments of the function definition are known as formal arguments.
 Function Call :
When the function get called by the calling function then that is called, function
call. The compiler execute these functions when the semicolon is followed by the
function name.
Example:-
function(arg1,arg2,arg3);
The argument that are used inside the function call are called actual argument
Ex:-
int S=sum(a, b); //actual arguments
MANSI TYAGI
PARAMETER PASSING:
Parameters are nothing but input information given to a function. By passing
parameters the caller can ask the function to process a set of values. Parameter passing
allows you to run generalized and reusable functions.
 What ever the parameters the caller passes are called the actual parameters and
 what ever parameters the function is return to receive are called the formal
parameters.
 The actual parameters are copied to the formal parameters.
The arguments which are mentioned or used inside the function call is knows as
actual argument and these are the original values and copy of these are actually
sent to the called function.
 The actual parameters are copied to the formal parameters.
It can be written as constant, expression or any function call like
Function (x);
Function (20, 30);
Example
Main()
{
Int ans;
Ans=add(a,b);
Actual argument
1. Actual Argument
1. Actual Argument
MANSI TYAGI
The arguments which are mentioned in function definition are called formal
arguments or dummy arguments.These arguments are used to just hold the copied
of the values that are sent by the calling function through the function call.
Example:
Int add (int x, int y) //*function definition*//
Formal Parameter/Argument
SCOPE OF VARIABLES
Scope of a variable means the portion of the program within which it can be
referenced and lifetime means the time of its existence in the memory.
The scope of local variables is limited to the functions in which they are declared,
or in other words these variables are inaccessible outside of the function. Like
wise the scope of the block variables is limited to the block in which they are
declared. Global have a scope that spans the entire source program, which is why
they can be used in any function.
1>.Local Variable 2>.Global Variable
1. LOCAL VARIABLES: Local variables that are defined with in a body of
function or block. The local variables can be used only in that function or block in
which they are declared.
Example : function()
{
int a,b;
2. Formal Argument
MANSI TYAGI
function 1();
}
2.GLOBAL VARIABLES :
These variables that are defined outside of the function is called global
variable/External variables. All functions in the program can access and modify
global variables.
 A global variable can be used any where in the program.
 Global variables are automatically initialized at the time of initialization.
Example:
#include<stdio.h>
void function(void);
void function1(void);
void function2(void);
int a, b=20; // * global variables *//
void main()
{
printf(“inside main a=%d,b=%d n”,a,b);
function();
function1();
function2();
}
function()
{
Prinf(“inside function a=%d,b=%dn”,a,b);
}
function 1()
{
GLOBAL vs LOCAL VARIABLES:
1. Local variables can be used only inside the function of the block in which they are
declared. On the other hand global variables are used through out the program.
MANSI TYAGI
2. All global variables, in the absence of explicit initialization, are automatically
initialized to zero. On the other hand All local variables, in the absence of explicit
initialization, are automatically initialized to garbage value.
3. The initial that you supplied for a global variable must be a constant, where as a
local variable can contain variable in its initializer.
4. A local variables loses its value the movement the function/block containing it is
exited. So you cannot expect a local variable to retain the value deposited in it the
previous time the function/block was entered. Global variables retain there values
through the program’s execution.
i) Function with no argument & no return value
Function that have no argument and no return value is written as:-
SYNTAX :
void function(void);
main()
{
void function()
{
Statement;
}
Category of Function based on argument and return type
i) Function with no argument & no return value
ii) Function with no argument but return value
iii ) function with argument but no return value
iv) function with argument and return value
MANSI TYAGI
Example :
#include<stdio.h>
#include<conio.h>
Void add (void);
{ Main()
Add();
}
Void add (void)
{
Int a,b,c;
Printf(“enter two valu”);
Scanf(“%d%d”,&a,&b);
C=a+b;
Printf(“%d”,c);
}
ii) Function with no argument but return value
Syntax:-
int fun(void);
main()
MANSI TYAGI
{
int r;
r=fun();
}
int fun()
{
reurn(exp);
}
Example:-
int sum();
main()
{
int b=sum();
printf(“entered %dn, b”);
}
int sum()
{
int a,b,s;
s=a+b;
return s;
}
Here called function is independent and are initialized. The values aren’t
passed by the calling function .Here the calling function and called function are
communicated partly with each other.
iii ) function with argument but no return value
Here the function have argument so the calling function send data to the called
function but called function does not return value.
MANSI TYAGI
Syntax:-
void fun (int,int);
main()
{
int (a,b);
}
void fun(int x, int y);
{
Statement;
}
Here the result obtained by the called function.
iv) function with argument and return value
Here the calling function has the argument to pass to the called function and the
called function returned value to the calling function.
Syntax:-
fun(int,int);
main()
{
int r=fun(a,b);
}
int fun(intx,inty)
{
return(exp);
}
 Example:
main()
{
int fun(int);
int a,num;
printf(“enter value:n”);
scanf(“%d”,&a)
int num=fun(a);
}
int fun(int x)
{
++x;
MANSI TYAGI
return x;
}
Call by value and call by reference
There are two way through which we can pass the arguments to the
function such as call by value and call by reference.
1. Call by value
In the call by value copy of the actual argument is passed to the
formal argument and the operation is done on formal argument.When
the function is called by ‘call by value’ method.
 It does not affect content of the actual argument. Changes made
to formal argument are local to block of called function so when
the control back to calling function the changes made is vanish.
 Example:-
main()
{
int x,y;
change(int,int);
printf(“enter two values:n”);
scanf(“%d%d”,&x,&y);
MANSI TYAGI
change(x ,y);
printf(“value of x=%d and y=%dn”,x ,y);
}
change(int a,int b);
{
int k;
k=a;
a=b;
b=k;
}
Output: enter two values: 12 ,23
Value of x=12 and y=23
2. Call by reference
Instead of passing the value of variable, address or reference is
passed and the function operate on address of the variable rather than
value.
 Here formal argument is alter to the actual argument, it
means formal arguments calls the actual arguments.
 Example:-
void main()
{
int a,b;
MANSI TYAGI
change(int *,int*);
printf(“enter two values:n”);
scanf(“%d%d”,&a,&b);
change(&a,&b);
printf(“after changing two value of a=%d and b=%dn:”a,b);
}
change(int *a, int *b)
{
int k;
k=*a;
*a=*b;
*b= k;
printf(“value in this function a=%d and b=%dn”,*a,*b);
}
Output: enter two values: 12, 32
Value in this function a=32 and b=12
After changing two value of a=32 and b=12
 So here instead of passing value of the variable, directly
passing address of the variables. Formal argument directly
access the value and swapping is possible even after calling a
function.
MANSI TYAGI
STORAGE CLASSES:
The storage class in C provides the complete information about the location and
visibility of variables.
 To define a variable in C one needs to mention not only its but also its
storage class. In other words , not only do all variables have a data type,
they also have a storage class.
 If we do not specify the storage class of a variable in its declaration , the
compiler will resume a storage class dependent on the context in which the
variable is used. Thus C has got certain default storage classes.
 Moreover, a variables storage class tells us:
 Where the variable would be stored.
 What will be the initial value of the variable , if the initial value is not
specifically assigned( i.e. the default initial value)
 What is the scope of the variable i.e in which function the value of
the variable would be available.
 What is the life of the variable, i.e. how long would the variable exist.
TYPES OF STORAGE CLASSES:
a) Automatic storage class.
b) Register storage class.
c) Static storage class.
d) External storage class.
MANSI TYAGI
1. AUTOMATIC VARIABLES: Automatic variables are declared
inside a function in which they are used they are to be utilized.
They are created when the function is called and destroyed
automatically when they are declared. Because of this property,
automatic variables are also referred to as local or internal
variables.
Syntax :
We may also use the key word auto to declare automatic variables.
main()
{
auto int n;
Statements;
}
FEATURES OF AUTOMATIC
1.Storage : Memory
2.Default initial value : A garbage value
3.Scope: Local to the block in which it is declared.
4.Life: As long as the program control remains
within the block in which it is declared.
MANSI TYAGI
2.REGISTERS STORAGE CLASSES :
We can tell the compiler that a variable should be kept in one of the machine’s
register, instead of keeping in the memory. Since a register access is much faster
than a memory access. Keeping the frequently accessed variables in the register
will lead to faster execution of programs.
Syntax :
register int i;
3.STATIC STORAGE CLASS:
As the name suggests, the value of static variables persists until the end of the
program. A variable can be declared static using the keyword static.
A static variables may be either an internal type or an external type, depending on
the place of declaration.
main()
{
int i;
FEATURES OF REGISTERS
1.Storage : Memory
2.Default initial value : A garbage value
3.Scope: Local to the block in which it is declared.
4.Life: As long as the program control remains
within the block in which it is declared.
MANSI TYAGI
for(i=1;i<=3;i++)
fun();
}
fun()
{
static int x=5;
x=x+3;
printf(“x=%dn”, x);
}
4.EXTERNAL STORAGE CLASS:
Variables that are both alive and active throughout the entire program are known as
external variables. They are also known as global variables. External variables are
declared outside a function.
FEATURES OF STATIC
1.Storage : Memory
2.Default initial value : ZERO
3.Scope: Local to the block in which it is declared.
4.Life:Variables retains its value betwwn different
functions calls.
FEATURES OF STATIC
1.Storage : Memory
2.Default initial value : ZERO
3.Scope: In all functions of a program i.e: global
4.Life: Throughout the program execution.
MANSI TYAGI
Recursion
The function called by itself (inside function body) is called
recursive function and this process often referred as
recursion.
 In recursion calling function and called function are same.
 It is powerful technique of writing complicated algorithm in easiest way.
 According to recursion problem is defined in term of itself. Here statement
with in body of the function calls the same function and same times it is
called as circular definition.
 In other words recursion is the process of defining something in form of
itself.
Important conditions: There are two important conditions that must be satisfied
by any recursive procedure.
1.Each time a procedure calls itself, it must be nearer to a solution.
2.There must be a decision criterion for stopping the computation.
Types of recursion:
There are two types of recursions.
1.The first type concerns recursively defined functions. Example of this
kind is the Factorial function.
2.The second type of recursion is the recursive use of a procedure.
Syntax:
main ()
{
rec(); /*function call*/
rec();
rec();
MANSI TYAGI
Ex:- /*calculate factorial of a no.using recursion*/
#include<stdio.h>
#include<conio.h>
int fact(int);
void main()
{
int num;
printf(“enter a number”);
scanf(“%d”,&num);
f=fact(num);
printf(“factorial is =%dn”f);
}
fact (int num)
{
If (num==0||num==1)
return 1;
else
return(num*fact(num-1));
}
MANSI TYAGI
IMPORTANT QUESTIONS
Q1. What is user defined functions?what is recursion?what are the
conditions for recursion to be convergent?write a recursive function to
compute factorial of a given number?Make use of this function to
compute the value of NCr.
Q2.Distinguish between Call by value and Call by reference methods of
parameter passings by giving suitable example?
Q3.Explain the concept of Storage classes.Explain eaxh with an
example.
Q4.Explain the concept of variables?
Q5.What is Recursion? Explain with its suitable example.
Q6. What do you understand by functions?Explain with its types.
Q7. What is user defined functions?How can you return a value from a
function?Explain with an example .Also discuss different methods to
pass parameters to a function by giving suitable examples.

More Related Content

What's hot (20)

Storage Class in C Progrmming
Storage Class in C Progrmming Storage Class in C Progrmming
Storage Class in C Progrmming
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Types of function call
Types of function callTypes of function call
Types of function call
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
friend function(c++)
friend function(c++)friend function(c++)
friend function(c++)
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Function in c
Function in cFunction in c
Function in c
 
String functions in C
String functions in CString functions in C
String functions in C
 
Presentation on C Switch Case Statements
Presentation on C Switch Case StatementsPresentation on C Switch Case Statements
Presentation on C Switch Case Statements
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Strings
StringsStrings
Strings
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
user defined function
user defined functionuser defined function
user defined function
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
 
FUNCTIONS IN C PROGRAMMING.pdf
FUNCTIONS IN C PROGRAMMING.pdfFUNCTIONS IN C PROGRAMMING.pdf
FUNCTIONS IN C PROGRAMMING.pdf
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
Tokens in C++
Tokens in C++Tokens in C++
Tokens in C++
 

Similar to FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)

Similar to FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) (20)

Functions
Functions Functions
Functions
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
Chapter 11 Function
Chapter 11 FunctionChapter 11 Function
Chapter 11 Function
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 
Module 3-Functions
Module 3-FunctionsModule 3-Functions
Module 3-Functions
 
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
 
C functions list
C functions listC functions list
C functions list
 
Amit user defined functions xi (2)
Amit  user defined functions xi (2)Amit  user defined functions xi (2)
Amit user defined functions xi (2)
 
PSPC-UNIT-4.pdf
PSPC-UNIT-4.pdfPSPC-UNIT-4.pdf
PSPC-UNIT-4.pdf
 
[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
USER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfUSER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdf
 
VIT351 Software Development VI Unit1
VIT351 Software Development VI Unit1VIT351 Software Development VI Unit1
VIT351 Software Development VI Unit1
 
4. function
4. function4. function
4. function
 
Functions in c
Functions in cFunctions in c
Functions in c
 
FUNCTION CPU
FUNCTION CPUFUNCTION CPU
FUNCTION CPU
 
Chapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdfChapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdf
 

More from Mansi Tyagi

Unit 5 INTERNATIONAL THEORY
Unit 5 INTERNATIONAL THEORYUnit 5 INTERNATIONAL THEORY
Unit 5 INTERNATIONAL THEORYMansi Tyagi
 
Unit 2 foreign trade topic 2 3 4 5
Unit 2 foreign trade topic 2 3 4 5Unit 2 foreign trade topic 2 3 4 5
Unit 2 foreign trade topic 2 3 4 5Mansi Tyagi
 
Unit 2 Foreign trade
Unit 2 Foreign tradeUnit 2 Foreign trade
Unit 2 Foreign tradeMansi Tyagi
 
Unit 1 international trade
Unit 1 international tradeUnit 1 international trade
Unit 1 international tradeMansi Tyagi
 
Unit 1 international trade theory
Unit 1 international trade theoryUnit 1 international trade theory
Unit 1 international trade theoryMansi Tyagi
 
Unit 5 Sales Management
Unit 5 Sales ManagementUnit 5 Sales Management
Unit 5 Sales ManagementMansi Tyagi
 
Unit 4 Sales Management
Unit 4 Sales ManagementUnit 4 Sales Management
Unit 4 Sales ManagementMansi Tyagi
 
Unit 3 Sales Management
Unit 3 Sales ManagementUnit 3 Sales Management
Unit 3 Sales ManagementMansi Tyagi
 
Unit 2 Sales Management
Unit 2 Sales ManagementUnit 2 Sales Management
Unit 2 Sales ManagementMansi Tyagi
 
Unit 1 Sales Mgt
Unit  1 Sales Mgt Unit  1 Sales Mgt
Unit 1 Sales Mgt Mansi Tyagi
 
C Language Programs
C Language Programs C Language Programs
C Language Programs Mansi Tyagi
 
RESEARCH REPORT
RESEARCH REPORT RESEARCH REPORT
RESEARCH REPORT Mansi Tyagi
 
A study of employee motivation
A study of employee motivationA study of employee motivation
A study of employee motivationMansi Tyagi
 
PROJECT REPORT ON CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL)
PROJECT REPORT ON  CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL) PROJECT REPORT ON  CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL)
PROJECT REPORT ON CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL) Mansi Tyagi
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEMMansi Tyagi
 
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)Mansi Tyagi
 
PROJECT ON ANDROID APPLICATION
PROJECT ON ANDROID APPLICATIONPROJECT ON ANDROID APPLICATION
PROJECT ON ANDROID APPLICATIONMansi Tyagi
 
Role of digital marketing
Role of digital marketingRole of digital marketing
Role of digital marketingMansi Tyagi
 
BUSINESS REPORT WRITING
BUSINESS REPORT WRITINGBUSINESS REPORT WRITING
BUSINESS REPORT WRITINGMansi Tyagi
 

More from Mansi Tyagi (20)

Unit 5 INTERNATIONAL THEORY
Unit 5 INTERNATIONAL THEORYUnit 5 INTERNATIONAL THEORY
Unit 5 INTERNATIONAL THEORY
 
Unit 2 foreign trade topic 2 3 4 5
Unit 2 foreign trade topic 2 3 4 5Unit 2 foreign trade topic 2 3 4 5
Unit 2 foreign trade topic 2 3 4 5
 
Unit 2 Foreign trade
Unit 2 Foreign tradeUnit 2 Foreign trade
Unit 2 Foreign trade
 
Unit 1 international trade
Unit 1 international tradeUnit 1 international trade
Unit 1 international trade
 
Unit 1 international trade theory
Unit 1 international trade theoryUnit 1 international trade theory
Unit 1 international trade theory
 
Unit 5 Sales Management
Unit 5 Sales ManagementUnit 5 Sales Management
Unit 5 Sales Management
 
Unit 4 Sales Management
Unit 4 Sales ManagementUnit 4 Sales Management
Unit 4 Sales Management
 
Unit 3 Sales Management
Unit 3 Sales ManagementUnit 3 Sales Management
Unit 3 Sales Management
 
Unit 2 Sales Management
Unit 2 Sales ManagementUnit 2 Sales Management
Unit 2 Sales Management
 
Unit 1 Sales Mgt
Unit  1 Sales Mgt Unit  1 Sales Mgt
Unit 1 Sales Mgt
 
C Language Programs
C Language Programs C Language Programs
C Language Programs
 
BONUS ACT (HRM)
BONUS ACT (HRM)BONUS ACT (HRM)
BONUS ACT (HRM)
 
RESEARCH REPORT
RESEARCH REPORT RESEARCH REPORT
RESEARCH REPORT
 
A study of employee motivation
A study of employee motivationA study of employee motivation
A study of employee motivation
 
PROJECT REPORT ON CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL)
PROJECT REPORT ON  CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL) PROJECT REPORT ON  CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL)
PROJECT REPORT ON CONSUMER BUYING BEHAVIOUR IN INDIAN SHOPPING MALL)
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
 
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
Problem solving UNIT - 4 [C PROGRAMMING] (BCA I SEM)
 
PROJECT ON ANDROID APPLICATION
PROJECT ON ANDROID APPLICATIONPROJECT ON ANDROID APPLICATION
PROJECT ON ANDROID APPLICATION
 
Role of digital marketing
Role of digital marketingRole of digital marketing
Role of digital marketing
 
BUSINESS REPORT WRITING
BUSINESS REPORT WRITINGBUSINESS REPORT WRITING
BUSINESS REPORT WRITING
 

Recently uploaded

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Recently uploaded (20)

USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)

  • 1. MANSI TYAGI FUNCTION De_nition  A’C’ program consists of one or more functions.  Every program must contain atleast one function named as main( ), where the program always begins execution.  Functions are normally used to divide a large program into smaller programs which are easier to handle.  Function after its execution returns a single value. Need of Functions :of Function Several advantages of modularizing a program into function includes:  Reduction in code redundancy  Enabling code reuse  Better readability  Information Hiding  Improved debugging and testing  Improved maintainability Abhineet A function is a self contained block of codes or sub programs with a set of statements that perform some specific task or coherent task.
  • 2. MANSI TYAGI There are basically two types of function those are: 1. Library function 2. User defined function 1. Library /Built in /Standard function : These functions that are inbuilt in the C language compiler are library functions i.e: printf() and scanf() belongs to the category of library functions.  These functions are present in C library and they are predefined. For ex: printf(),scanf(),getch(),clrscr(),main(). 2. User defined function : These functions that are defined by the user according to its requirement at the time of writing the program.  User can create their own functions for performing any specific task of the program.These types of functions are called user-defined functions.  There are three aspect of working with user-defined functions: 1. Function Declaration, also known as function prototype 2. Function Definition 3. Function Call or function invocation
  • 3. MANSI TYAGI Syntax:- Return type function name (argument list ) Return type name of function (type 1 arg 1, type2 arg2, type3 arg3)  So when user gets his own function three thing he has to know, these are. Function declaration Function definition Function call These three things are represented like : int function(int, int, int); /*function declaration*/ main() { function(arg1,arg2,arg3); /* calling function*/ } int function(type 1 arg 1,type2 arg2,type3, arg3) /*function definition/* { Local variable declaration; Statement; Return value; }  Function declaration:- Function declaration is also known as function prototype. It inform the compiler about three thing, those are name of the function, and type of argument received by the function and the type of value returned by the function.  Function prototype always terminated by the semicolon. Syntax: Type function_name(parameter list); int function(int, int, int); /*function declaration* Ex- int add(int x,int y);
  • 4. MANSI TYAGI  Function definition:- Function definition consists of the whole description and code of the function. It tells about what function is doing what are its inputs and what are its out put It consists of two parts function header and function body. Syntax:- return type function(type 1 arg1, type2 arg2, type3 arg3) /*function header*/ { Local variable declaration; Statement 1; Statement 2; /*function body*/ Return value; }  The local variable declared inside a function is local to that function only. It can’t be used anywhere in the program and its existence is only within this function.  The arguments of the function definition are known as formal arguments.  Function Call : When the function get called by the calling function then that is called, function call. The compiler execute these functions when the semicolon is followed by the function name. Example:- function(arg1,arg2,arg3); The argument that are used inside the function call are called actual argument Ex:- int S=sum(a, b); //actual arguments
  • 5. MANSI TYAGI PARAMETER PASSING: Parameters are nothing but input information given to a function. By passing parameters the caller can ask the function to process a set of values. Parameter passing allows you to run generalized and reusable functions.  What ever the parameters the caller passes are called the actual parameters and  what ever parameters the function is return to receive are called the formal parameters.  The actual parameters are copied to the formal parameters. The arguments which are mentioned or used inside the function call is knows as actual argument and these are the original values and copy of these are actually sent to the called function.  The actual parameters are copied to the formal parameters. It can be written as constant, expression or any function call like Function (x); Function (20, 30); Example Main() { Int ans; Ans=add(a,b); Actual argument 1. Actual Argument 1. Actual Argument
  • 6. MANSI TYAGI The arguments which are mentioned in function definition are called formal arguments or dummy arguments.These arguments are used to just hold the copied of the values that are sent by the calling function through the function call. Example: Int add (int x, int y) //*function definition*// Formal Parameter/Argument SCOPE OF VARIABLES Scope of a variable means the portion of the program within which it can be referenced and lifetime means the time of its existence in the memory. The scope of local variables is limited to the functions in which they are declared, or in other words these variables are inaccessible outside of the function. Like wise the scope of the block variables is limited to the block in which they are declared. Global have a scope that spans the entire source program, which is why they can be used in any function. 1>.Local Variable 2>.Global Variable 1. LOCAL VARIABLES: Local variables that are defined with in a body of function or block. The local variables can be used only in that function or block in which they are declared. Example : function() { int a,b; 2. Formal Argument
  • 7. MANSI TYAGI function 1(); } 2.GLOBAL VARIABLES : These variables that are defined outside of the function is called global variable/External variables. All functions in the program can access and modify global variables.  A global variable can be used any where in the program.  Global variables are automatically initialized at the time of initialization. Example: #include<stdio.h> void function(void); void function1(void); void function2(void); int a, b=20; // * global variables *// void main() { printf(“inside main a=%d,b=%d n”,a,b); function(); function1(); function2(); } function() { Prinf(“inside function a=%d,b=%dn”,a,b); } function 1() { GLOBAL vs LOCAL VARIABLES: 1. Local variables can be used only inside the function of the block in which they are declared. On the other hand global variables are used through out the program.
  • 8. MANSI TYAGI 2. All global variables, in the absence of explicit initialization, are automatically initialized to zero. On the other hand All local variables, in the absence of explicit initialization, are automatically initialized to garbage value. 3. The initial that you supplied for a global variable must be a constant, where as a local variable can contain variable in its initializer. 4. A local variables loses its value the movement the function/block containing it is exited. So you cannot expect a local variable to retain the value deposited in it the previous time the function/block was entered. Global variables retain there values through the program’s execution. i) Function with no argument & no return value Function that have no argument and no return value is written as:- SYNTAX : void function(void); main() { void function() { Statement; } Category of Function based on argument and return type i) Function with no argument & no return value ii) Function with no argument but return value iii ) function with argument but no return value iv) function with argument and return value
  • 9. MANSI TYAGI Example : #include<stdio.h> #include<conio.h> Void add (void); { Main() Add(); } Void add (void) { Int a,b,c; Printf(“enter two valu”); Scanf(“%d%d”,&a,&b); C=a+b; Printf(“%d”,c); } ii) Function with no argument but return value Syntax:- int fun(void); main()
  • 10. MANSI TYAGI { int r; r=fun(); } int fun() { reurn(exp); } Example:- int sum(); main() { int b=sum(); printf(“entered %dn, b”); } int sum() { int a,b,s; s=a+b; return s; } Here called function is independent and are initialized. The values aren’t passed by the calling function .Here the calling function and called function are communicated partly with each other. iii ) function with argument but no return value Here the function have argument so the calling function send data to the called function but called function does not return value.
  • 11. MANSI TYAGI Syntax:- void fun (int,int); main() { int (a,b); } void fun(int x, int y); { Statement; } Here the result obtained by the called function. iv) function with argument and return value Here the calling function has the argument to pass to the called function and the called function returned value to the calling function. Syntax:- fun(int,int); main() { int r=fun(a,b); } int fun(intx,inty) { return(exp); }  Example: main() { int fun(int); int a,num; printf(“enter value:n”); scanf(“%d”,&a) int num=fun(a); } int fun(int x) { ++x;
  • 12. MANSI TYAGI return x; } Call by value and call by reference There are two way through which we can pass the arguments to the function such as call by value and call by reference. 1. Call by value In the call by value copy of the actual argument is passed to the formal argument and the operation is done on formal argument.When the function is called by ‘call by value’ method.  It does not affect content of the actual argument. Changes made to formal argument are local to block of called function so when the control back to calling function the changes made is vanish.  Example:- main() { int x,y; change(int,int); printf(“enter two values:n”); scanf(“%d%d”,&x,&y);
  • 13. MANSI TYAGI change(x ,y); printf(“value of x=%d and y=%dn”,x ,y); } change(int a,int b); { int k; k=a; a=b; b=k; } Output: enter two values: 12 ,23 Value of x=12 and y=23 2. Call by reference Instead of passing the value of variable, address or reference is passed and the function operate on address of the variable rather than value.  Here formal argument is alter to the actual argument, it means formal arguments calls the actual arguments.  Example:- void main() { int a,b;
  • 14. MANSI TYAGI change(int *,int*); printf(“enter two values:n”); scanf(“%d%d”,&a,&b); change(&a,&b); printf(“after changing two value of a=%d and b=%dn:”a,b); } change(int *a, int *b) { int k; k=*a; *a=*b; *b= k; printf(“value in this function a=%d and b=%dn”,*a,*b); } Output: enter two values: 12, 32 Value in this function a=32 and b=12 After changing two value of a=32 and b=12  So here instead of passing value of the variable, directly passing address of the variables. Formal argument directly access the value and swapping is possible even after calling a function.
  • 15. MANSI TYAGI STORAGE CLASSES: The storage class in C provides the complete information about the location and visibility of variables.  To define a variable in C one needs to mention not only its but also its storage class. In other words , not only do all variables have a data type, they also have a storage class.  If we do not specify the storage class of a variable in its declaration , the compiler will resume a storage class dependent on the context in which the variable is used. Thus C has got certain default storage classes.  Moreover, a variables storage class tells us:  Where the variable would be stored.  What will be the initial value of the variable , if the initial value is not specifically assigned( i.e. the default initial value)  What is the scope of the variable i.e in which function the value of the variable would be available.  What is the life of the variable, i.e. how long would the variable exist. TYPES OF STORAGE CLASSES: a) Automatic storage class. b) Register storage class. c) Static storage class. d) External storage class.
  • 16. MANSI TYAGI 1. AUTOMATIC VARIABLES: Automatic variables are declared inside a function in which they are used they are to be utilized. They are created when the function is called and destroyed automatically when they are declared. Because of this property, automatic variables are also referred to as local or internal variables. Syntax : We may also use the key word auto to declare automatic variables. main() { auto int n; Statements; } FEATURES OF AUTOMATIC 1.Storage : Memory 2.Default initial value : A garbage value 3.Scope: Local to the block in which it is declared. 4.Life: As long as the program control remains within the block in which it is declared.
  • 17. MANSI TYAGI 2.REGISTERS STORAGE CLASSES : We can tell the compiler that a variable should be kept in one of the machine’s register, instead of keeping in the memory. Since a register access is much faster than a memory access. Keeping the frequently accessed variables in the register will lead to faster execution of programs. Syntax : register int i; 3.STATIC STORAGE CLASS: As the name suggests, the value of static variables persists until the end of the program. A variable can be declared static using the keyword static. A static variables may be either an internal type or an external type, depending on the place of declaration. main() { int i; FEATURES OF REGISTERS 1.Storage : Memory 2.Default initial value : A garbage value 3.Scope: Local to the block in which it is declared. 4.Life: As long as the program control remains within the block in which it is declared.
  • 18. MANSI TYAGI for(i=1;i<=3;i++) fun(); } fun() { static int x=5; x=x+3; printf(“x=%dn”, x); } 4.EXTERNAL STORAGE CLASS: Variables that are both alive and active throughout the entire program are known as external variables. They are also known as global variables. External variables are declared outside a function. FEATURES OF STATIC 1.Storage : Memory 2.Default initial value : ZERO 3.Scope: Local to the block in which it is declared. 4.Life:Variables retains its value betwwn different functions calls. FEATURES OF STATIC 1.Storage : Memory 2.Default initial value : ZERO 3.Scope: In all functions of a program i.e: global 4.Life: Throughout the program execution.
  • 19. MANSI TYAGI Recursion The function called by itself (inside function body) is called recursive function and this process often referred as recursion.  In recursion calling function and called function are same.  It is powerful technique of writing complicated algorithm in easiest way.  According to recursion problem is defined in term of itself. Here statement with in body of the function calls the same function and same times it is called as circular definition.  In other words recursion is the process of defining something in form of itself. Important conditions: There are two important conditions that must be satisfied by any recursive procedure. 1.Each time a procedure calls itself, it must be nearer to a solution. 2.There must be a decision criterion for stopping the computation. Types of recursion: There are two types of recursions. 1.The first type concerns recursively defined functions. Example of this kind is the Factorial function. 2.The second type of recursion is the recursive use of a procedure. Syntax: main () { rec(); /*function call*/ rec(); rec();
  • 20. MANSI TYAGI Ex:- /*calculate factorial of a no.using recursion*/ #include<stdio.h> #include<conio.h> int fact(int); void main() { int num; printf(“enter a number”); scanf(“%d”,&num); f=fact(num); printf(“factorial is =%dn”f); } fact (int num) { If (num==0||num==1) return 1; else return(num*fact(num-1)); }
  • 21. MANSI TYAGI IMPORTANT QUESTIONS Q1. What is user defined functions?what is recursion?what are the conditions for recursion to be convergent?write a recursive function to compute factorial of a given number?Make use of this function to compute the value of NCr. Q2.Distinguish between Call by value and Call by reference methods of parameter passings by giving suitable example? Q3.Explain the concept of Storage classes.Explain eaxh with an example. Q4.Explain the concept of variables? Q5.What is Recursion? Explain with its suitable example. Q6. What do you understand by functions?Explain with its types. Q7. What is user defined functions?How can you return a value from a function?Explain with an example .Also discuss different methods to pass parameters to a function by giving suitable examples.