Functions are blocks of code that perform tasks and can be reused. Large projects require functions to organize code and avoid repetition. Functions accept input, process it, and return output. Functions can be built-in to PHP or user-defined. User-defined functions are created using the function keyword and can accept arguments passed by value or reference. Arrays allow storing multiple values and are indexed with keys and values. Arrays can be numerically or associatively indexed.
User-defined functions allow programmers to define reusable blocks of code to perform tasks. Functions are defined using the function keyword followed by a name and parameters. Code within the function body is executed when the function is called. Functions may take arguments, have default values, return values, and be called recursively. Functions can also be defined inside other functions.
Functions in PHP allow programmers to organize code into reusable blocks. There are built-in and user-defined functions. User-defined functions use the function keyword and can accept arguments, return values, and be called elsewhere in the code. Functions can pass arguments by value, where changes inside the function don't affect the original variable, or by reference, where changes are reflected outside the function. Functions can also have default argument values and static variables that retain their value between calls.
This document discusses PHP functions and arrays. It defines PHP functions as reusable pieces of code that can take arguments and return values. There are built-in and user-defined functions. Arrays allow storing multiple values in a single variable. PHP supports indexed, associative, and multidimensional arrays. Indexed arrays use numeric indexes while associative arrays use named keys. Multidimensional arrays store arrays within other arrays, allowing representation of tabular data. Functions and arrays are fundamental PHP concepts that improve code reuse and organization.
This document discusses PHP functions including:
- The syntax and advantages of functions
- Common string, numeric, and date/time functions
- Creating user-defined functions
- Passing arguments to functions
- Returning values from functions
The document provides examples of using built-in PHP functions like strlen(), rand(), date(), and creating user-defined functions that can accept arguments and return values. It also discusses concepts like default arguments and stopping function execution with return.
The document discusses functions in PHP. It defines what a function is and some key properties like having a unique name, performing independent tasks without interfering with other code, and optionally returning values. It provides examples of built-in PHP functions for arrays, characters, and numbers. It also covers user-defined functions, passing arguments by value and reference, variable scopes, and using static variables in functions.
This document discusses PHP functions and arrays. It defines PHP functions as reusable blocks of code that can be called repeatedly using the function name. User-defined functions in PHP start with the "function" keyword. Functions can accept arguments and return values. Arrays allow storing multiple values in a single variable and accessing them via numeric indexes. The document provides examples of creating, accessing, and looping through indexed arrays in PHP code.
This document discusses PHP functions and modularity. It explains why functions are used to organize code and avoid repetition. Built-in PHP functions are powerful, and custom functions can be created by defining them with the function keyword. Functions can take arguments, return values, and be called by reference. Variable scope is also covered, noting that function variables are usually isolated unless declared global. The document demonstrates including other files to split code into multiple files and check for function existence. Overall it provides an overview of functions and modularity in PHP.
This document discusses PHP functions and modularity. It explains why functions are used to organize code and avoid repetition. Built-in PHP functions are powerful, and custom functions can be created by defining them with the function keyword. Functions can take arguments, return values, and be called by reference. Variable scope is also covered, noting that function variables are usually isolated unless declared global. The document demonstrates including other files to split code into multiple files and check for function existence. Overall it provides an overview of functions and modularity in PHP.
This document outlines PHP functions including function declaration, arguments, returning values, variable scope, static variables, recursion, and useful built-in functions. Functions are blocks of code that perform tasks and can take arguments. They are declared with the function keyword followed by the name and parameters. Functions can return values and arguments are passed by value by default but can also be passed by reference. Variable scope inside functions refers to the local scope unless specified as global. Static variables retain their value between function calls. Recursion occurs when a function calls itself. Useful built-in functions include function_exists() and get_defined_functions().
Functions allow programmers to organize and reuse code. PHP has many built-in functions for common string and date/time operations. Programmers can also define their own functions. Functions can accept arguments, use default values, be called by value or reference, and be recursive. Variable scope inside functions prevents naming collisions with external variables. Well-formed PHP functions follow naming conventions and can contain other functions and classes.
why function,built in function,arguments,default arguments,call by value,call by reference,recursive function,variable scope,user defined function,date/time function
php 2 Function creating, calling,PHP built-in functiontumetr1
The document discusses PHP functions, including how to create and call custom functions, and examples of useful built-in PHP functions. It explains that functions allow reusable blocks of code and built-in functions are pre-made and do not need to be created. Examples are provided for creating functions that take parameters and return values, as well as calling functions. Common built-in functions are also described, such as trim(), explode(), implode(), and print_r() which operate on strings and arrays.
This document provides an overview of server-side scripting using PHP. It includes 15 questions covering PHP topics like variables, data types, arrays, functions, and form handling. The questions are worth a total of 15 marks and include multiple choice, fill in the blank, true/false, and code writing questions. The document then provides details on PHP including an introduction, how it is well-suited for web development, examples of first PHP code, and explanations of variables, data types, arrays, control structures, functions and comments.
This document discusses PHP functions and how to define, call, and use them. It covers defining functions, arguments and parameters, default argument values, variable scope, and including library files. Functions allow reusable blocks of code and avoid duplicating code. Arguments are values passed into a function, while parameters are variable names used inside the function. Default arguments can be set so functions still work if not all arguments are passed. Variable scope determines where variables can be accessed. Library files allow storing functions in one place and including them elsewhere.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
The document discusses various PHP concepts like operators, comments, if/else statements, loops, functions etc. It provides code examples for each concept. Some key points covered are:
- PHP operators are used to perform operations on operands and can be categorized into arithmetic, bitwise, logical etc.
- Comments can be used to describe code or hide code and PHP supports single line and multi line comments.
- Control structures like if/else, switch are used to execute code conditionally based on tests.
- Loops like for, foreach, while, do-while are used to repeat code.
- Functions allow code reusability and can take arguments to pass input and return output. Functions can also use
This document provides an overview of loops, functions, and dates in PHP. It discusses for loops, using the date() function to output different date formats, and how to declare user-defined functions in PHP with optional arguments and return values. Examples are given for each concept and exercises provided to help reinforce the content.
This document discusses various PHP functions categorized into different groups like:
- Date Functions: date, getdate, setdate, Checkdate, time, mktime
- String Functions: strtolower, strtoupper, strlen, trim, substr, strcmp etc.
- Math Functions: abs, ceil, floor, round, pow, sqrt, rand
- User Defined Functions: functions with arguments, default arguments, returning values
- File Handling Functions: fopen, fread, fwrite, fclose to handle files
- Miscellaneous Functions: define, constant, include, require, header to define constants, include files etc.
This document provides an overview of PHP including:
- Basic PHP syntax like variables, data types, operators, and control structures
- Functions - both built-in and user-defined, including arguments and return values
- Loops - while, do-while, for, foreach
- Object-oriented concepts like classes, objects, constructors, inheritance
- Arrays - indexed, associative, and multidimensional
- Strings and math functions
- An introduction to abstraction and object-oriented programming principles in PHP
To define responsive web design means that your website (and its pages) can adapt and deliver the best experience to users, whether they’re on their desktop, laptop, tablet, or smartphone. For that to happen, though, your website needs a responsive design.
More Related Content
Similar to function in php using like three type of function (20)
This document discusses PHP functions and modularity. It explains why functions are used to organize code and avoid repetition. Built-in PHP functions are powerful, and custom functions can be created by defining them with the function keyword. Functions can take arguments, return values, and be called by reference. Variable scope is also covered, noting that function variables are usually isolated unless declared global. The document demonstrates including other files to split code into multiple files and check for function existence. Overall it provides an overview of functions and modularity in PHP.
This document outlines PHP functions including function declaration, arguments, returning values, variable scope, static variables, recursion, and useful built-in functions. Functions are blocks of code that perform tasks and can take arguments. They are declared with the function keyword followed by the name and parameters. Functions can return values and arguments are passed by value by default but can also be passed by reference. Variable scope inside functions refers to the local scope unless specified as global. Static variables retain their value between function calls. Recursion occurs when a function calls itself. Useful built-in functions include function_exists() and get_defined_functions().
Functions allow programmers to organize and reuse code. PHP has many built-in functions for common string and date/time operations. Programmers can also define their own functions. Functions can accept arguments, use default values, be called by value or reference, and be recursive. Variable scope inside functions prevents naming collisions with external variables. Well-formed PHP functions follow naming conventions and can contain other functions and classes.
why function,built in function,arguments,default arguments,call by value,call by reference,recursive function,variable scope,user defined function,date/time function
php 2 Function creating, calling,PHP built-in functiontumetr1
The document discusses PHP functions, including how to create and call custom functions, and examples of useful built-in PHP functions. It explains that functions allow reusable blocks of code and built-in functions are pre-made and do not need to be created. Examples are provided for creating functions that take parameters and return values, as well as calling functions. Common built-in functions are also described, such as trim(), explode(), implode(), and print_r() which operate on strings and arrays.
This document provides an overview of server-side scripting using PHP. It includes 15 questions covering PHP topics like variables, data types, arrays, functions, and form handling. The questions are worth a total of 15 marks and include multiple choice, fill in the blank, true/false, and code writing questions. The document then provides details on PHP including an introduction, how it is well-suited for web development, examples of first PHP code, and explanations of variables, data types, arrays, control structures, functions and comments.
This document discusses PHP functions and how to define, call, and use them. It covers defining functions, arguments and parameters, default argument values, variable scope, and including library files. Functions allow reusable blocks of code and avoid duplicating code. Arguments are values passed into a function, while parameters are variable names used inside the function. Default arguments can be set so functions still work if not all arguments are passed. Variable scope determines where variables can be accessed. Library files allow storing functions in one place and including them elsewhere.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
The document discusses various PHP concepts like operators, comments, if/else statements, loops, functions etc. It provides code examples for each concept. Some key points covered are:
- PHP operators are used to perform operations on operands and can be categorized into arithmetic, bitwise, logical etc.
- Comments can be used to describe code or hide code and PHP supports single line and multi line comments.
- Control structures like if/else, switch are used to execute code conditionally based on tests.
- Loops like for, foreach, while, do-while are used to repeat code.
- Functions allow code reusability and can take arguments to pass input and return output. Functions can also use
This document provides an overview of loops, functions, and dates in PHP. It discusses for loops, using the date() function to output different date formats, and how to declare user-defined functions in PHP with optional arguments and return values. Examples are given for each concept and exercises provided to help reinforce the content.
This document discusses various PHP functions categorized into different groups like:
- Date Functions: date, getdate, setdate, Checkdate, time, mktime
- String Functions: strtolower, strtoupper, strlen, trim, substr, strcmp etc.
- Math Functions: abs, ceil, floor, round, pow, sqrt, rand
- User Defined Functions: functions with arguments, default arguments, returning values
- File Handling Functions: fopen, fread, fwrite, fclose to handle files
- Miscellaneous Functions: define, constant, include, require, header to define constants, include files etc.
This document provides an overview of PHP including:
- Basic PHP syntax like variables, data types, operators, and control structures
- Functions - both built-in and user-defined, including arguments and return values
- Loops - while, do-while, for, foreach
- Object-oriented concepts like classes, objects, constructors, inheritance
- Arrays - indexed, associative, and multidimensional
- Strings and math functions
- An introduction to abstraction and object-oriented programming principles in PHP
To define responsive web design means that your website (and its pages) can adapt and deliver the best experience to users, whether they’re on their desktop, laptop, tablet, or smartphone. For that to happen, though, your website needs a responsive design.
software evelopment life cycle model and example of water fall modelvishal choudhary
studying the existing or obsolete system and software,
conducting interviews of users and developers,
referring to the database or
collecting answers from the questionnaires.
software Engineering lecture on development life cyclevishal choudhary
SDLC starts from the moment, when it’s made a decision to launch the project.
There is no one single SDLC model.
They are divided into groups,
Each with its features and weaknesses
The document provides an introduction to software engineering. It defines software engineering as an engineering discipline concerned with all aspects of software production. It discusses why software engineering is important given that errors in complex software systems can have devastating consequences, as shown through examples of software failures in air traffic control, satellite launches, and ambulance dispatch systems. The document also covers fundamental software engineering concepts like the software process, process models, and costs.
The document discusses software testing concepts like validation testing vs defect testing, system and component testing strategies, and test automation tools. It defines key terms like bugs, defects, errors, faults, and failures. It also describes techniques like equivalence partitioning and boundary value analysis that are used to generate test cases that thoroughly test software. Component testing tests individual program parts while system testing tests integrated groups of components. Test cases specify conditions to determine if software works as intended.
Completed Sunday 6/8. For Weekend 6/14 & 15th. (Fathers Day Weekend US.) These workshops are also timeless for future students TY. No admissions needed.
A 9th FREE WORKSHOP
Reiki - Yoga
“Intuition-II, The Chakras”
Your Attendance is valued.
We hit over 5k views for Spring Workshops and Updates-TY.
Thank you for attending our workshops.
If you are new, do welcome.
Grad Students: I am planning a Reiki-Yoga Master Course (As a package). I’m Fusing both together.
This will include the foundation of each practice. Our Free Workshops can be used with any Reiki Yoga training package. Traditional Reiki does host rules and ethics. Its silent and within the JP Culture/Area/Training/Word of Mouth. It allows remote healing but there’s limits As practitioners and masters, we are not allowed to share certain secrets/tools. Some content is designed only for “Masters”. Some yoga are similar like the Kriya Yoga-Church (Vowed Lessons). We will review both Reiki and Yoga (Master tools) in the Course upcoming.
S9/This Week’s Focus:
* A continuation of Intuition-2 Development. We will review the Chakra System - Our temple. A misguided, misused situation lol. This will also serve Attunement later.
Thx for tuning in. Your time investment is valued. I do select topics related to our timeline and community. For those seeking upgrades or Reiki Levels. Stay tuned for our June packages. It’s for self employed/Practitioners/Coaches…
Review & Topics:
* Reiki Is Japanese Energy Healing used Globally.
* Yoga is over 5k years old from India. It hosts many styles, teacher versions, and it’s Mainstream now vs decades ago.
* Anything of the Holistic, Wellness Department can be fused together. My origins are Alternative, Complementary Medicine. In short, I call this ND. I am also a metaphysician. I learnt during the 90s New Age Era. I forget we just hit another wavy. It’s GenZ word of Mouth, their New Age Era. WHOA, History Repeats lol. We are fusing together.
* So, most of you have experienced your Spiritual Awakening. However; The journey wont be perfect. There will be some roller coaster events. The perks are: We are in a faster Spiritual Zone than the 90s. There’s more support and information available.
(See Presentation for all sections, THX AGAIN.)
Slides from a Capitol Technology University presentation covering doctoral programs offered by the university. All programs are online, and regionally accredited. The presentation covers degree program details, tuition, financial aid and the application process.
Analysis of Quantitative Data Parametric and non-parametric tests.pptxShrutidhara2
This presentation covers the following points--
Parametric Tests
• Testing the Significance of the Difference between Means
• Analysis of Variance (ANOVA) - One way and Two way
• Analysis of Co-variance (One-way)
Non-Parametric Tests:
• Chi-Square test
• Sign test
• Median test
• Sum of Rank test
• Mann-Whitney U-test
Moreover, it includes a comparison of parametric and non-parametric tests, a comparison of one-way ANOVA, two-way ANOVA, and one-way ANCOVA.
Ray Dalio How Countries go Broke the Big CycleDadang Solihin
A complete and practical understanding of the Big Debt Cycle. A much more practical understanding of how supply and demand really work compared to the conventional economic thinking. A complete and practical understanding of the Overall Big Cycle, which is driven by the Big Debt Cycle and the other major cycles, including the big political cycle within countries that changes political orders and the big geopolitical cycle that changes world orders.
Rose Cultivation Practices by Kushal Lamichhane.pdfkushallamichhame
This includes the overall cultivation practices of Rose prepared by:
Kushal Lamichhane (AKL)
Instructor
Shree Gandhi Adarsha Secondary School
Kageshowri Manohara-09, Kathmandu, Nepal
Artificial intelligence Presented by JM.jmansha170
AI (Artificial Intelligence) :
"AI is the ability of machines to mimic human intelligence, such as learning, decision-making, and problem-solving."
Important Points about AI:
1. Learning – AI can learn from data (Machine Learning).
2. Automation – It helps automate repetitive tasks.
3. Decision Making – AI can analyze and make decisions faster than humans.
4. Natural Language Processing (NLP) – AI can understand and generate human language.
5. Vision & Recognition – AI can recognize images, faces, and patterns.
6. Used In – Healthcare, finance, robotics, education, and more.
Owner By:
Name : Junaid Mansha
Work : Web Developer and Graphics Designer
Contact us : +92 322 2291672
Email : [email protected]
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...parmarjuli1412
The document provides an overview of therapeutic communication, emphasizing its importance in nursing to address patient needs and establish effective relationships. THERAPEUTIC COMMUNICATION included some topics like introduction of COMMUNICATION, definition, types, process of communication, definition therapeutic communication, goal, techniques of therapeutic communication, non-therapeutic communication, few ways to improved therapeutic communication, characteristics of therapeutic communication, barrier of THERAPEUTIC RELATIONSHIP, introduction of interpersonal relationship, types of IPR, elements/ dynamics of IPR, introduction of therapeutic nurse patient relationship, definition, purpose, elements/characteristics , and phases of therapeutic communication, definition of Johari window, uses, what actually model represent and its areas, THERAPEUTIC IMPASSES and its management in 5th semester Bsc. nursing and 2nd GNM students
How to Configure Vendor Management in Lunch App of Odoo 18Celine George
The Vendor management in the Lunch app of Odoo 18 is the central hub for managing all aspects of the restaurants or caterers that provide food for your employees.
Adam Grant: Transforming Work Culture Through Organizational PsychologyPrachi Shah
This presentation explores the groundbreaking work of Adam Grant, renowned organizational psychologist and bestselling author. It highlights his key theories on giving, motivation, leadership, and workplace dynamics that have revolutionized how organizations think about productivity, collaboration, and employee well-being. Ideal for students, HR professionals, and leadership enthusiasts, this deck includes insights from his major works like Give and Take, Originals, and Think Again, along with interactive elements for enhanced engagement.
Unit- 4 Biostatistics & Research Methodology.pdfKRUTIKA CHANNE
Blocking and confounding (when a third variable, or confounder, influences both the exposure and the outcome) system for Two-level factorials (a type of experimental design where each factor (independent variable) is investigated at only two levels, typically denoted as "high" and "low" or "+1" and "-1")
Regression modeling (statistical model that estimates the relationship between one dependent variable and one or more independent variables using a line): Hypothesis testing in Simple and Multiple regression models
Introduction to Practical components of Industrial and Clinical Trials Problems: Statistical Analysis Using Excel, SPSS, MINITAB®️, DESIGN OF EXPERIMENTS, R - Online Statistical Software to Industrial and Clinical trial approach
RE-LIVE THE EUPHORIA!!!!
The Quiz club of PSGCAS brings to you a fun-filled breezy general quiz set from numismatics to sports to pop culture.
Re-live the Euphoria!!!
QM: Eiraiezhil R K,
BA Economics (2022-25),
The Quiz club of PSGCAS
*Order Hemiptera:*
Hemiptera, commonly known as true bugs, is a large and diverse order of insects that includes cicadas, aphids, leafhoppers, and shield bugs. Characterized by their piercing-sucking mouthparts, Hemiptera feed on plant sap, other insects, or small animals. Many species are significant pests, while others are beneficial predators.
*Order Neuroptera:*
Neuroptera, also known as net-winged insects, is an order of insects that includes lacewings, antlions, and owlflies. Characterized by their delicate, net-like wing venation and large, often prominent eyes, Neuroptera are predators that feed on other insects, playing an important role in biological control. Many species have aquatic larvae, adding to their ecological diversity.
Human Anatomy and Physiology II Unit 3 B pharm Sem 2
Respiratory system
Anatomy of respiratory system with special reference to anatomy
of lungs, mechanism of respiration, regulation of respiration
Lung Volumes and capacities transport of respiratory gases,
artificial respiration, and resuscitation methods
Urinary system
Anatomy of urinary tract with special reference to anatomy of
kidney and nephrons, functions of kidney and urinary tract,
physiology of urine formation, micturition reflex and role of
kidneys in acid base balance, role of RAS in kidney and
disorders of kidney
Different pricelists for different shops in odoo Point of Sale in Odoo 17Celine George
Price lists are a useful tool for managing the costs of your goods and services. This can assist you in working with other businesses effectively and maximizing your revenues. Additionally, you can provide your customers discounts by using price lists.
2. What is a Function in PHP
• A Function in PHP is a reusable piece or block of code that
performs a specific action.
4. Create a User Defined Function in PHP
A user-defined function declaration starts with the word function:
6. PHP User Defined Functions
Besides the built-in PHP functions, it is possible to create your own functions.
•A function is a block of statements that can be used repeatedly in a
program.
•A function will not execute automatically when a page loads.
•A function will be executed by a call to the function.
7. Why use Functions?
•Better code organization – PHP functions allow us to group blocks of
related code that perform a specific task together.
•Reusability – once defined, a function can be called by a number of scripts
in our PHP files. This saves us time of reinventing the wheel when we want
to perform some routine tasks such as connecting to the database
•Easy maintenance- updates to the system only need to be made in one
place.
9. Advantage of PHP Functions
Code Reusability: PHP functions are defined only once and can be invoked
many times, like in other programming languages.
Less Code: It saves a lot of code because you don't need to write the logic
many times. By the use of function, you can write the logic only once and
reuse it.
Easy to understand: PHP functions separate the programming logic. So it
is easier to understand the flow of the application because every logic is
divided in the form of functions.
11. PHP Function Arguments
• Information can be passed to functions through arguments. An
argument is just like a variable.
• Arguments are specified after the function name, inside the
parentheses. You can add as many arguments as you want, just
separate them with a comma.
20. PHP strict typing
• In this example, the add() function
accepts two integers and returns the
sum of them.
• However, when you pass two floats
1.5 and 2.5, the add() function
returns 3 because PHP implicitly
coerces the values to the target types
by default.
• In this case, PHP coerces the floats
into integers.
• To enable strict typing, you can use
the declare (strict_types=1); directive
at the beginning of the file.
21. • To enable strict typing, you can use the declare(strict_types=1);
• By adding the strict typing directive to the file, the code will
execute in the strict mode. PHP enables the strict mode on a
per-file basis.
• In the strict mode, PHP expects the values with the type
matching with the target types. If there’s a mismatch, PHP will
issue an error.
26. Parameter passing to Functions
PHP allows us two ways in which an argument can be passed into a function:
•Pass by Value: On passing arguments using pass by value, the value of the
argument gets changed within a function, but the original value outside the
function remains unchanged. That means a duplicate of the original value is
passed as an argument.
•Pass by Reference: On passing arguments as pass by reference, the original
value is passed. Therefore, the original value gets altered. In pass by reference we
actually pass the address of the value, where it is stored using ampersand
sign(&).
38. PHP Default Parameters
• The following defines the concat() function that concatenates two strings
with a delimiter:
39. • -PHP allows you to specify a default argument for a parameter.
For example:
• In this example, the $delimiter parameter takes the space as
the default argument.
40. PHP Anonymous Functions
• When you define a function, you specify a name for it. Later, you can call the
function by its name.
• For example, to define a function that multiplies two numbers, you
can do it as follows:
41. • An anonymous function is a function that doesn’t have a name.
• The following example defines an anonymous function that
multiplies two numbers:
42. 1. Code to generate factorial of a number using recursive function in PHP.
TRY THIS
2. Write a program to print numbers from 10 to 1 using the
recursion function.