If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?



If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?..

Answer / padmas

The above line of the code gets executed using the C++ program, the output will give 10 as value of b at the prompt. It will process the b+=(5%7*2), as b values is already given as 6 then it will add, to the assigned value to the result got from the expression. if properly syntaxes and executed the program.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

What is oops in programming?

1 Answers  


What are benefits of oop?

0 Answers  


Why do we need oop?

0 Answers  


What do you mean by pure virtual functions?

8 Answers  


Which type does string inherit from?

0 Answers  


function overridind means and simple program

2 Answers  


What is encapsulation selenium?

0 Answers  


#include <iostream> using namespace std; int main() { int a = 3; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][2]; }

1 Answers  


explain defference between structure and class with example

1 Answers  


explain dynamic binding by drowing

2 Answers   Cognizant,


for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)

2 Answers  


Can anyone please explain runtime polymorphism with a real time example??at what ciscumstances we go for it??

1 Answers  


Categories