Computer Science, asked by yaswanth534, 10 months ago

what is function in c language ​

Answers

Answered by Shubhgyanji
59

Answer:

In general function means task.

In computer language, it is a program which does a certain type of task. For example, you want to add two numbers, you can do it manually, but if you want to do it multiple times, 100 times or 1000 times, it becomes redundant. For this we can create a function 'Addition' in 'C' language and we can use whenever we need to add values.

1. Function reduces efforts and repetition

2. It reduces the size of the program

3. It helps in organizing and debugging programs

4. C language has lot of inbuilt functions, and we can also create our own function as per needs.

Explanation:

The syntax to create function is :

return_type function_name (argument list)

{

   Set of statements – Block of code

}

Answered by varun13154
11

Answer:

hiii friend

Explanation:

A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions.

You can divide up your code into separate functions. How you divide up your code among different functions is up to you, but logically the division is such that each function performs a specific task.

A function declaration tells the compiler about a function's name, return type, and parameters. A function definition provides the actual body of the function.

The C standard library provides numerous built-in functions that your program can call. For example, strcat() to concatenate two strings, memcpy() to copy one memory location to another location, and many more functions.

Similar questions