answersLogoWhite

0


Best Answer

First question: You can define zero or more functions before main, and zero or more functions after it. It's up to you. Of course you have to have prototypes for functions which are called before their definitions.

Second question: Good programming style includes many things, for example:

- keep your functions simple, short, easy to understand and modify

- orginize the code into modules (separate source files), the size of a module should be below a few thousands line.

- don't use global variable instead of function parameters

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Friends pls clear my doubt In C function should be defined after main function as a Good programming style Why?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is d command for squareroot in C programming?

There are no commands in C-programming, you should use function sqrt from math.h


How does the compiler differentiate the statement and function in C programming?

statement should not return a value but function returns a value


Can you define a function inside a function?

No. Functions should be defined separately. So you would not define a function within a function. You can define one function, and while defining another function, you can call the first function from its code.


What can a function be defined as?

Definition: By function We Means In C which Perform Some Specific Task..e.g Print Scan etc. The function Should Inclosed of Parantheses. There Are two Types Of Function 1.User Define Function 2.Built in function


What mean by deprecated in java programming?

It means that the function is old (and often poorly designed) so should not be used anymore. It is kept there for backwards compatibility.


Why should wave function be single valued and finite?

The wave function should be single-valued to ensure that physical observables, such as energy, are well-defined. If the wave function were not single-valued, it could lead to inconsistencies in quantum mechanics. Additionally, the wave function should be finite to ensure that the probability of finding a particle in a given region is well-defined and normalized to unity.


When deciding whether a set of programming steps should be placed in a sub procedure or a function procedures what are three questions you should ask?

I don't understand your question. In C, all called routines are functions.


Is it bad for women to have a lot of guy friends or is trust just and issue?

The answer to whether it is bad for women to have alot of guy friends depends on the people involved and how the relationship is defined. If they are just friends, then trust should not be an issue. If they are more than friends, then trust may be an issue.


Several advantages to using a modular approach in programming?

It is easy to understand small sections of code in the modular programming.You can store the code across multiple files.Modular programming allows collaborative programming. Collaborative programming means more than one program work in one application at the same time.Duplication of code is not possible in modular programming. The programmers create a single procedure for code.The errors are localized to a subroutine or function and it is easy to find the errors.The code should be used in multiple applications in modular programming.The code should be simple and short in modular programming and it is less need to be written.


What is optimal feasible solution?

It is usually the answer in linear programming. The objective of linear programming is to find the optimum solution (maximum or minimum) of an objective function under a number of linear constraints. The constraints should generate a feasible region: a region in which all the constraints are satisfied. The optimal feasible solution is a solution that lies in this region and also optimises the obective function.


Should have basic knowledge of programming?

no


Why should variables be declared in a programming?

a variable should in a programming because as the definition implies it is a named location in the memory where all the data is to be stored