Professional Documents
Culture Documents
W4L1
W4L1
Indranil Saha
CS253: Software Development and Operations Object-Oriented Programming Using C++ 1/7
Introduction
CS253: Software Development and Operations Object-Oriented Programming Using C++ 2/7
Hello World in C++
hello world!!
#include <iostream>
using namespace std;
CS253: Software Development and Operations Object-Oriented Programming Using C++ 3/7
Input/Output in C++
cin/cout
#include <iostream>
using namespace std;
int main() {
char name[50];
Output
Please enter your name: cplusplus
Your name is: cplusplus
CS253: Software Development and Operations Object-Oriented Programming Using C++ 4/7
Namespace
Defining a namespace
namespace namespace_name {
// code declarations
}
CS253: Software Development and Operations Object-Oriented Programming Using C++ 5/7
Example: Namespace
Output
Inside first_space
Inside second_space
CS253: Software Development and Operations Object-Oriented Programming Using C++ 6/7
Object-Oriented Programming Using C++
Input-Output and Namespace
Indranil Saha
CS253: Software Development and Operations Object-Oriented Programming Using C++ 7/7