0 votes
179 views
in C program by (1.7k points)
edited

when is the “void” keyword used in a function?

1 Answer

0 votes
by (1.7k points)
selected by
 
Best answer
When declaring functions, you will decide whether that function would be returning a value or not. If that function will not return a value, such as when the purpose of a function is to display some outputs on the screen, then “void” is to be placed at the leftmost part of the function header. When a return value is expected after the function execution, the data type of the return value is placed instead of “void”.

Related questions

+1 vote
1 answer 132 views
0 votes
1 answer 126 views
asked May 15, 2022 in C program by Doubtly (98.9k points)
0 votes
1 answer 2.8k views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

561 users

...