Skip to content

Commit 67cc5f9

Browse files
authored
Add files via upload
1 parent 5d5231b commit 67cc5f9

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <iostream>
2+
using namespace std; // Using Directives
3+
//using std::cout; //only making the particular function available
4+
5+
int main()
6+
{
7+
int slices = 5; //Declarration and Initialization
8+
slices = 10; // Assignment
9+
cout<<"You have "<<slices<<" slices"<<endl; // Concatenation. cout object of ostream. "<<" operator operates on strings and cout.
10+
return 0;// Return 0 everything done properly
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include<iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
cout<<"Hello\tThere\n"; // \t for tab spacing \n for new line
6+
cout<<"Hello\bThere\0 \n"; // \b for backslashing a character \0 for null string
7+
cout<<"\"Hello\"\v\'There\'\n"; // \" for double quotes \v for vertical tabs \' for single quotes
8+
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <iostream>
2+
using namespace std; // Using Directives
3+
//using std::cout; //only making the particular function available
4+
5+
int main()
6+
{
7+
int slices;
8+
cout<<"How many slices:";
9+
cin>>slices; // cin instance of istream. Takes input from console
10+
cout<<"You have "<<slices<<" slices"<<endl;
11+
return 0;
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include<iostream>
2+
int main()// main function
3+
{
4+
std::cout<<"Hello ";
5+
std::cout<<"World\n";
6+
std::cout<<"Welcome to c++ programming"<<std::endl;
7+
return 0;
8+
}

0 commit comments

Comments
 (0)