File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ #include < iostream>
2+ using namespace std ;
3+ int main ()
4+ {
5+ cout<<" Hello\t There\n " ; // \t for tab spacing \n for new line
6+ cout<<" Hello\b There\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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments