Programming Syntax Cheat Sheet V 1.0 PDF
Programming Syntax Cheat Sheet V 1.0 PDF
Version 1.0
#include <iostream>
using namespace std;
C++
int Main() {
}
<script>
Javascript
</script>
int var_1;
C++
char var_2;
var_1=2
Declaring a Variable Python
var_2= "This is a string"
$var_1 = 2 ;
PHP
$var_2="This is a string" ;
var var_1=2;
Javascript
var var_2="This is a string";
def func_01 :
Python var_1=2
var_2= "This is a string"
function func_01 {
var_1=2 ;
PHP
var_2= "This is a string";
}
function func_01 {
var var_1=2;
Javascript
var var_2="This is a string";
}
if (x == 100)
cout << "x is 100";
C++
else
cout << "x is not 100";
if( x < 20 ){
System.out.print("This is if statement");
}else{
Java
System.out.print("This is else statement");
}
}
a=1
If Statement if a > 5:
Python print "This shouldn't happen."
else:
print "This should happen."
System.out.print("\n");
For Loop String [] names ={"James", "Larry", "Tom", "Lacy"};
for( String name : names ) {
Java
System.out.print( name );
System.out.print(",");
}
for item in items:
Python print(number, item)
number = number + 1
cin >> x;
C++
//Takes the value from user and stores in x
//In PHP taking input from user will need a PHP form
<form action="welcome.php" method="post">
Name: <input type="text" name="name">
PHP
E-mail: <input type="text" name="email">
<input type="submit">
</form>
Javascript
<script>
document.write(5 + 6);
</script>