C++ Output Questions

  1. Find Error/Output in follwing code:
  2.                             
    #include <iostream>  
    
    using namespace std;  

    void square (int *x)  {
        *x = (*x)++ * (*x);  


    void square (int *x, int *y) {
        *x = (*x) * --(*y); 


    int main ( ) {
        int number = 30;          
        square(&number, &number);           
        cout << number;           
        return 0;  
    }
    1. 910
    2. 920
    3. 870
    4. 900
Answer :
C
Explanation:
Added By : Sumit

Post Your Question
Social Sharing
Search