Stream 00
Stream 00
};
};
CPP14
#include <iostream>
using namespace std;
int main()
{
char x;
cout << x;
}
Input:
g
Output:
g
CPP14
#include <iostream>
using namespace std;
int main()
{
char x;
// used to scan a single char
cin.get(x);
1. Input:
g
Output:
g
CPP14
#include <iostream>
using namespace std;
int main()
{
Output:
geeks
CPP14
#include <iostream>
using namespace std;
class demo {
public:
int dx, dy;
int main()
{
demo d;
cout << "Enter two numbers dx and dy\n";
cout << "dx = " << d.dx << "\tdy = " << d.dy;
}
Input:
45
Output:
Enter two numbers dx and dy
45
dx = 4 dy = 5
CPP14
#include <iostream>
using namespace std;
class demo {
public:
int dx, dy;
demo()
{
dx = 4;
dy = 5;
}
int main()
{
demo d; // default constructor is called
Output:
Value of dx and dy are
45