What Can Function Prototypes Do Without Parameters and Return Values?

In summary, A function without parameters or returning values is essentially a procedure that executes a specific code. It can still perform tasks such as keyboard and screen input, but it is not required to do so. The purpose of a function is to organize and modularize code, making it easier to read and maintain. Even if a function does not return a value or print anything on the screen, it can still perform important tasks in a program.
  • #1
Luongo
120
0
Just some basic questions i have about function prototypes (functions)
What's an example of a code which has no parameters? ie: double func(void)
what is the purpose if the thing doesn't take in parameters? also, what if there is keyboard input and screen input what does that mean in the function prototype? does it usually happen? what's the point of having a function if it doesn't RETURN any useful stuff to main? or prints nothing on the screen?
 
Physics news on Phys.org
  • #2
A function can still do lots of things, even without parameters and returning a value. It will execute whatever code is in the function.

In this way it's basically a Procedure.
 

1. What is C programming?

C programming is a high-level programming language that was developed in the early 1970s by Dennis Ritchie. It is a structured and efficient language that is widely used for developing operating systems, device drivers, and system software.

2. What are the main features of C programming?

C programming is known for its low-level memory access, simple syntax, and powerful set of built-in functions. It also allows for direct manipulation of memory and has a rich library of functions for various tasks like string manipulation, input/output operations, and mathematical calculations.

3. What are some common applications of C programming?

C programming is commonly used in developing operating systems, device drivers, embedded systems, and software for microcontrollers. It is also used in developing high-performance applications, such as databases and graphics engines.

4. Is C programming difficult to learn?

C programming can be challenging to learn, especially for beginners with no prior programming experience. However, with practice and dedication, it can be mastered. It is recommended to start with simpler programming languages before delving into C programming.

5. What are the benefits of learning C programming?

Learning C programming can open up many opportunities in the field of computer science. It is a widely used language, so having a strong understanding of it can make you a valuable asset to companies. It also helps develop problem-solving skills and a deeper understanding of how computers work at a low level.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
3K
  • Programming and Computer Science
Replies
11
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
25
Views
14K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
12
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
Back
Top