logging in or signing up C++ Basic Tutorial assignmenthelpn Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 59 Category: Education License: All Rights Reserved Like it (0) Dislike it (0) Added: January 30, 2012 This Presentation is Public Favorites: 0 Presentation Description Assignmenthelp.net provides excellent online help services in C++ programming Assignment Help assignmenthelp.net/c-plus-plus.php Comments Posting comment... Premium member Presentation Transcript C++ Tutorial: C++ TutorialC++ program : C++ program #include <iostream.h> int main() { //variable declaration //read values input from user //computation and print output to user return 0; } www.assignmenthelp.netHello world program: Hello world program The Hello world program in C++. #include <iostream.h> int main() { cout << “Hello world!”; return 0; } www.assignmenthelp.netVariable declaration: Variable declaration type variable-name; Meaning: variable <variable-name> will be a variable of type <type> Where type can be: int //integer double //real number char //character Example: int a, b, c; double x; int sum; char my-character; www.assignmenthelp.netInput statements: Input statements cin >> variable-name; Meaning: read the value of the variable called <variable-name> from the user Example: cin >> a; cin >> b >> c; cin >> x; cin >> my-character; www.assignmenthelp.netOutput statements: Output statements cout << variable-name; Meaning: print the value of variable <variable-name> to the user cout << “any message “; Meaning: print the message within quotes to the user cout << endl; Meaning: print a new line Example: cout << a; cout << b << c; cout << “This is my character: “ << my-character << “ he he he” << endl; www.assignmenthelp.netIf statements: If statements if (condition) { S1; } else { S2; } S3; condition S1 S2 S3 True False www.assignmenthelp.netBoolean conditions: Boolean conditions Comparison operators == equal != not equal < less than > greater than <= less than or equal >= greater than or equal Boolean operators && and || or ! not www.assignmenthelp.netC++ (if example): C++ (if example) #include <iostream.h> void main() { int I, j, k; cin >> i >> j >> k; if (i <=j) { cout << “min is “ << i << endl; } else { cout << “ min is “ << j << endl; } cout << “Output?” << endl; } www.assignmenthelp.netWhile statements: While statements while (condition) { S1; } S2; condition S1 S2 True False www.assignmenthelp.netWhile example: While example //read 100 numbers from the user and output their sum #include <iostream.h> void main() { int i , a, sum; sum=0; i =1; while ( i <= 100) { cin >> a; sum = sum + a; i = i+1; } cout << “sum is “ << sum << endl ; } www.assignmenthelp.netPowerPoint Presentation: Thank You Programming Project Help Any Time From Anywhere 24x7 Hr www.assignmenthelp.net Email Us at : support@assignmenthelp.net You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
C++ Basic Tutorial assignmenthelpn Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 59 Category: Education License: All Rights Reserved Like it (0) Dislike it (0) Added: January 30, 2012 This Presentation is Public Favorites: 0 Presentation Description Assignmenthelp.net provides excellent online help services in C++ programming Assignment Help assignmenthelp.net/c-plus-plus.php Comments Posting comment... Premium member Presentation Transcript C++ Tutorial: C++ TutorialC++ program : C++ program #include <iostream.h> int main() { //variable declaration //read values input from user //computation and print output to user return 0; } www.assignmenthelp.netHello world program: Hello world program The Hello world program in C++. #include <iostream.h> int main() { cout << “Hello world!”; return 0; } www.assignmenthelp.netVariable declaration: Variable declaration type variable-name; Meaning: variable <variable-name> will be a variable of type <type> Where type can be: int //integer double //real number char //character Example: int a, b, c; double x; int sum; char my-character; www.assignmenthelp.netInput statements: Input statements cin >> variable-name; Meaning: read the value of the variable called <variable-name> from the user Example: cin >> a; cin >> b >> c; cin >> x; cin >> my-character; www.assignmenthelp.netOutput statements: Output statements cout << variable-name; Meaning: print the value of variable <variable-name> to the user cout << “any message “; Meaning: print the message within quotes to the user cout << endl; Meaning: print a new line Example: cout << a; cout << b << c; cout << “This is my character: “ << my-character << “ he he he” << endl; www.assignmenthelp.netIf statements: If statements if (condition) { S1; } else { S2; } S3; condition S1 S2 S3 True False www.assignmenthelp.netBoolean conditions: Boolean conditions Comparison operators == equal != not equal < less than > greater than <= less than or equal >= greater than or equal Boolean operators && and || or ! not www.assignmenthelp.netC++ (if example): C++ (if example) #include <iostream.h> void main() { int I, j, k; cin >> i >> j >> k; if (i <=j) { cout << “min is “ << i << endl; } else { cout << “ min is “ << j << endl; } cout << “Output?” << endl; } www.assignmenthelp.netWhile statements: While statements while (condition) { S1; } S2; condition S1 S2 True False www.assignmenthelp.netWhile example: While example //read 100 numbers from the user and output their sum #include <iostream.h> void main() { int i , a, sum; sum=0; i =1; while ( i <= 100) { cin >> a; sum = sum + a; i = i+1; } cout << “sum is “ << sum << endl ; } www.assignmenthelp.netPowerPoint Presentation: Thank You Programming Project Help Any Time From Anywhere 24x7 Hr www.assignmenthelp.net Email Us at : support@assignmenthelp.net