-
What is the output of this program?
#include
using namespace std;
int Fun(int p, int q)
{
int res;
res = 0;
while (q != 0)
{
res = res + p;
q = q - 2;
}
return(res);
}
int main ()
{
int p = 12, q = 10;
cout << Fun(p, q) ;
return(0);
}
-
- 60
- 12
- 10
- Compilation Error
- None of these
Correct Option: A
We are multiplying these values by adding every values.