Mr. Walt's class

 

Redlands Conservatory C++ Core Language Programming!

 






   

 

 

C++ Programming for Scratch programmers!


Click Here to watch Video #1
Includes:  How to use this page, and three simple C++ programs with Scratch examples.

Click Here to watch Video #2
Includes:  How to do LOOPS in C++ with equivalent Scratch program examples.

Click Here to download more in depth notes/explanations.

 

What follows are Mr. Walt's samples to run and modify on the compiler at:
http://www.tutorialspoint.com/compile_cpp_online.php


// Sample #1 Hello World.


#include <iostream>

using namespace std;

int main()

{

   cout << "Hello World" << endl;

      return 0;

}


//  Sample #2.  Adding numbers.


#include <stdio.h>

#include <iostream>

using namespace std;

int main ()

{

  /* variable definition: */

 int a, b, c;

 cout << "Please enter an integer to add: ";

 cin >> a;

 cout << "Please enter a second integer to add: ";

 cin >> b;

 c = a + b;

 printf("Total = %d \n", c);

   return 0;

}


//Sample #3.  Loops.


#include <stdio.h>

int loop;

int main ()

{

for(loop=1;loop<=12; loop++)

     {

      printf("This loop will run 12 times.\n");

   }

   return 0;

}


 















Web site contents Copyright Walt Noon 2015, All rights reserved.