C++ Lesson 1

Lesson 1 includes an introduction to the C and C++ Programming Languages, a "Hello World" program, and a "Hello, enter a number:" program (Standard I/O)

#include <cstdio>
 
int main()
{
    printf( "Hello, World!" );
 
    scanf( "*" );
    return 0;
}
#include <cstdio>
 
int main()
{
    printf( "Hello, enter a number: " );
    int num;
    scanf( "%d", &num );
    printf( "You entered %d as your number.", num );
 
    fflush( stdin );
    scanf( "*" );
    return 0;
}
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-NonCommercial 3.0 License