Posts

Showing posts with the label function

What Is Functions In C++ ? || Explained By Examples || Function Types

Image
  👉 WHAT IS FUNCTION 👈 By - Dhruv Arne   Function – Function is a block of a code that is executed only when it is called in the code. In C++ if you want to make a function then the syntax is   Return_type   function_name ( parameter_datatype   parameters ( if  it have)) { Code Return  something; }   Here return type is the type of data which function is going to be returned. It is not mandatory that the function should have return something always, it is optional. But now you have a question in your mind that if we don’t return something then what we will write in the place of return_type when declaring a function?. I will tell you the answer you have to write void which means nothing. Void is a datatype in c++ that means nothing, so there is no example of a void data type because void means nothing. Now here in the syntax, I wrote a word parameter, so what does parameter mean?. Basically, parameters are a need of that functio...