C++ Programming - Functions - Discussion

Discussion Forum : Functions - Programs (Q.No. 11)
11.
Which of the following statement is correct about the program given below?
#include<iostream.h>
void Tester(int xx, int yy = 5);
class IndiaBix
{
    int x; 
    int y; 
    public:
    void Tester(int xx, int yy = 5)
    {
        x = xx;
        y = yy;
        cout<< ++x % --y; 
    }
};
int main()
{
    IndiaBix objBix;
    objBix.Tester(5, 5);
    return 0; 
}
The program will print the output 0.
The program will print the output 1.
The program will print the output 2.
The program will print the output garbage value.
The program will report compile time error.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Niketa said:   9 years ago
It is reporting compilation error invalid operands of types \'float\' and \'float\' to binary \'operator%.

Sathya said:   1 decade ago
From main xx=5,yy=5;
xx=x,yy=y;
++x=6,
--y=4,
++x%--y=6%4 = 2

Post your comments here:

Your comments will be displayed after verification.