546 views

1 Answer

0 votes
0 votes
Actually the return types that are defined are int,char, float or any of d basic data types. So therefore void is used when our function doesn't has to return any value. As regards parameters r concerned it has nothing to do with the return type.

You can declare d function in d following way

void fun(void,void);//same declaration

void fun(); //same as above

Which still means tat the function doesn't needs the parameters to be passed. In case you want to pass any parameter in d function which doesn't has a return type with any one of d basic data types as under:

void fun(int,int); Ans is therefore c). Okay. I hope d explanation helps u. Yeah. :)

Related questions

0 votes
0 votes
4 answers
1
iita asked Dec 31, 2016
563 views
0 votes
0 votes
0 answers
2
Dknights asked Jan 7, 2023
279 views
0 votes
0 votes
0 answers
3
abhinowKatore asked Dec 5, 2022
599 views
What will be the return value of the below function, if it is called a sample(4)? int sample(int x){ if( x == 0 || x ==2) return 1; return (sample( x) * (x ));}
–4 votes
–4 votes
2 answers
4
Souvik33 asked Oct 27, 2022
602 views
*MSQ*The following figure depicts a a. A tree and only treeb. A tree with 3 nodesc. A graph (Since every tree is a graph)d. A graph and only graph