Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main ()
{
    int a, b;         
    a = 10;           
    b = 4;            
    a = b;           
    b = 7;           
    cout << "a:";
    cout << a;
    cout << " b:";
    cout << b;
    return 0;
}

A. a:4 b:7

B. a:10 b:4

C. a:4 b:10

D. a:4 b:6

Answer: Option A


Join The Discussion

Related Questions on Classes and Objects in C plus plus