answersLogoWhite

0

A function is a block of code that has a name and it has a property that it is reusable i.e. it can be executed from as many different points in a C Program as required.

Function groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities - called functions in C - to get its tasks done. A function is a self contained block of statements that perform a coherent task of same kind

The name of the function is unique in a C Program and is Global. It neams that a function can be accessed from any location with in a C Program. We pass information to the function called arguments specified when the function is called. And the function either returns some value to the point it was called from or returns nothing.

We can divide a long C program into small blocks which can perform a certain task. A function is a self contained block of statements that perform a coherent task of same kind.

Structure of a Function

There are two main parts of the function. The function header and the function body.

int sum(int x, int y)

{

int ans = 0; //holds the answer that will be returned

ans = x + y; //calculate the sum

return ans //return the answer

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

What is function overriding in oop?

Function overriding in object-oriented programming (OOP) occurs when a subclass provides a specific implementation of a method that is already defined in its superclass. This allows the subclass to customize or extend the behavior of the inherited method. The overridden method in the subclass must have the same name, return type, and parameters as the method in the superclass. Function overriding is a key mechanism for achieving polymorphism, enabling dynamic method resolution at runtime.


What is difference between oop and advanced oop?

the word advanced. If these 2 are course titles, the institute should have the course descriptions. In software development, it would be the first time for me to hear about advanced oop. (what is the basic oop, then?)


What is Object Oriented Programming without the principle of Polymorphism?

Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.


Basic concepts of OOP?

The four main pillars of all OOP languages are encapsulation, inheritance, polymorphism and abstraction.


In OOP the concept of insulating data and from direct access by the program is known as?

In OOP, the concept of insulating data and from direct access by the program is known as

Related Questions

How data and function are organised in oop?

dfdafdaf


What is method in oop?

1) Function 2) Which will excute particular methof/function


What is the definition of seekg function in oop?

seekg sets the position of the get pointer in an input stream -- the point at which the next extraction will occur.


How do you ally oop in 2k9?

how to ally oop in nba 2k9


What is a one letter initial called?

The 'Initial'


When was ZZT-oop created?

ZZT-oop was created in 1991.


What bird goes oop oop oop?

The hoopoe makes a sound that goes 'oop oop oop.' In many cultures, the bird has a similar name because of this particular call they are known for. Hoopoes are birds from the Afro-Eurasian region. They have distinctive feather patterns in their wings and crests, as well as flat dark bills.


What is the duration of Allez Oop?

The duration of Allez Oop is 1260.0 seconds.


What is function overriding in oop?

Function overriding in object-oriented programming (OOP) occurs when a subclass provides a specific implementation of a method that is already defined in its superclass. This allows the subclass to customize or extend the behavior of the inherited method. The overridden method in the subclass must have the same name, return type, and parameters as the method in the superclass. Function overriding is a key mechanism for achieving polymorphism, enabling dynamic method resolution at runtime.


What is difference between oop and advanced oop?

the word advanced. If these 2 are course titles, the institute should have the course descriptions. In software development, it would be the first time for me to hear about advanced oop. (what is the basic oop, then?)


What is Object Oriented Programming without the principle of Polymorphism?

Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.Polymorphism is an important principle in OOP; it would be hard to imagine OOP without it. Other important principles are inheritance, and encapsulation.


How does a hoopoe communicate?

The hoopoe makes a sound like 'oop-oop-opp.'