answersLogoWhite

0

What is functions in c?

Updated: 12/21/2022
User Avatar

Wiki User

12y ago

Best Answer

A function is a small set of instructions designed to operate on its given input (aka parameters or arguments) and perform some action or return some output. Generally in programming a commonly used strategy is to take a large program and break it into smaller chunks, which are turned into functions.

So say that you are writing a large program and constantly have to see which of two numbers is larger, you could write a function:

int larger(int a, int b)

{

if(a > b)

return a;

else

return b;

}

Now in your program, you can simply say:

int x = larger(number1, number2);

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

A function is a a set of instructions which reduce the length of c program.we can reduce the length of program by calling a function.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

A piece of program-code.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is functions in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can there be friend functions in c plus plus?

Yes, there can be friend functions in C++.


What are the in-built function in c plus plus?

C++ built-in functions are those functions that are provided for you as part of the language itself, and includes all of the C standard library functions (all of which were inherited from C) and is expanded upon by the C++ standard template library. C++ implementors may provide additional functions that are platform-specific, however these are not considered built-in functions becuase C++ is a cross-platform language. These are best described as 3rd party functions. The functions you yourself write are known as user-defined functions.


What is the importance of using functions in a c program?

C programs do not function without functions.


How you describe operations of stack ADT using c template functions?

No, because C does not support the concept of template functions. Template functions only exist in C++, never in C.


How do you override functions in c?

Not possible in C, only in C++


To calculate odd and even parities which functions can be used?

could you be clear? what kind of functions you are asking? functions available in C, C++, java ? in C you can use mod() function or "%" operator to find the parities.


What is Nesting of functions in C?

Impossibility.


What is the header files from random functions?

The header file for random functions ( like rand(), srand() ) is stdlib.h in C and cstdlib in C++.


Why functions are not used in c plus plus?

Of course they are used. Both stand-alone and class-member functions are used in C++.


What does 'C date and time functions' refer to?

C date and time functions refer to a group of functions in the standard library of the C programming language that implements time and date operations like conversion between date formats.


Built-in functions in C?

You can have #include after Stdio.h ...it has so many built in mathematical functions like CIRCULAR FUNCTIONS, ABSOLUTE VALUE and more..Sadly, built-in functions and library functions are different things... there are no built-in functions in C (except for sizeof, which isn't an actual function).


What prototype for menu function takes no arguments but returns a char value?

char SomeFunction();This has nothing to do with menu functions. It is a straight C/C++ answer. Menu functions depend on the platform API, not on C/C++.