#include<iostream.h>
main(){
long int password;
for(int i=l; i<=3; i++){
cout<<"ENTER YOUR PASSWORD NUMBER:";
cin>>password;
if (password==876123) {cout<<"SUCCESS"<<endl;
return l;}
cout<<"INCORRECT PASSWORD RE-ENTER:
"<<endl;
}//FOR
cout<<"SORRY NO MORE";
return0;
}//MAIN
Most languages are very alike.
Some languages are case sensitive. If you don't folld the rules you get a SYNTAX ERROR. (easy to fix)
The first line is gibberish
C++ is a fast language. It only includes things you need.
As the version of the language becomes newer, it becomes more complicated. Do not use '.h' on the new version.
Header line tells the program to access some external files to be included in the program.
Java does the same thing.
Open parenthesis and close parenthesis looks like gibberish, just like brackets.
Main means MAIN FUNCTION, therefore there are subprograms or sub functions.
MAIN will act as a driver/ home page.
Int for integer= whole number.
Long integer: very long whole number
The first part of programming is to type it.
Rule of Language: C++ will obey the language of C++
Every program is made of 2 types of words. "Your" words and "language" (key/reserved) words.
Please give me a location that will allow me to store a big whole number.
cout<<"ENTER YOUR PASSWORD NUMBER:"; // this line displays the message
cin= grab in
C= console
Stored in your computer.
If is a very important statement. It is the heart of the search.
Compare password to 876123.
Double equal is match.
Return means go.
How many times do you have a chance to try this program? 3 look in brackets
//=comment