+ 2

What the void functions do and where can we use it? Please if you can give me some examples ..thanks🌸

3rd Jun 2018, 2:11 PM
sayed sayed
sayed sayed - avatar
2 odpowiedzi
+ 17
void which doesnot return anything for eg : void functionname() { cout<<"hello"; } 2)👉 int functionname(int a,int b) { return a*b; }// it is returning a*b so its non void
3rd Jun 2018, 2:26 PM
Vijay(v-star🌟)
Vijay(v-star🌟) - avatar
+ 1
we use void function when we don't want to return anything like when we use the function just to print something or read some data from user
3rd Jun 2018, 10:08 PM
Rawan
Rawan - avatar