Computer Science, asked by kakarsalil7952, 11 months ago

Write a program using simple function and parameterized function

Answers

Answered by kartheekvarma3667
0

Functions in C Programming

A function exists in almost all programming languages. As the word suggests, a function is a group of statements clubbed together to perform a particular task. Each function is accompanied by a set of parenthesis, the opening bracket ( and the closing bracket ). There may be a group of variable declarations called parameters inside these parenthesis. We will come to the detailed explanation of this as we move forward with the lesson. Please note that a function can also be termed as a subroutine or a procedure.

Types of Functions

Functions can be broadly categorized into two major types: user defined functions and built-in functions.

You may have used some built-in functions in C without realizing that it's a function. For example, the strcat() is a built-in function provided by C standard library, which allows you to concatenate two strings. User defined functions are functions defined by the user or the person writing the program. If you recall, the main() is also a function but is often coined as neither a user-defined function, not a built-in function or in some way behaves as both.

Answered by amannishad0512p5zxh6
0

class Parameter

  {

         public int add(int a,int b)

     {

             c=a+b;

           return(c);

           }

          public static void main()

       {

             Parameter  ob=new Parameter();

               int p =ob.add(15,3);

          System.out.println("Addition is "+p);

            }

       }

Hope it will help you @

Mark me brainlest !!

Similar questions