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;
}
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
xx=x,yy=y;
++x=6,
--y=4,
++x%--y=6%4 = 2
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers