+ 2
What the void functions do and where can we use it? Please if you can give me some examples ..thanks🌸
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
+ 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