Translate

Showing posts with label output. Show all posts
Showing posts with label output. Show all posts

A Basic C++ Program – How To

————————————————————————————
#include <iostream.h> //This is a simple Hello World Program.
int main()
{
cout<<”Hello World”;
return 0;
}
————————————————————————————
//This is a simple Hello World Program.
That line of code is a comment. It is useful for com

C++ Taking in User Input

We can have the user type in something and respond to their input. e.g.:
————————————————–
#include <iostream.h>
int main()
{
int num1;
cout<<”Enter a number: “;
cin>>num1;
cout<<”You

Simple Numeric i/o in C++

This example reads in three numbers of users and the number and average them and then print out the sum and average.


  1. #include <iostream>
  2. using namespace std;
  3. int main()