One of the first programs that one usually writes when learning any programming language is "Hello World!". Most of the programming language have same methodology and are almost similar to each other.
If you learn PHP you can easily understand C and vice versa and same with others, because they are related to each other. Below is the programming code for "Hello World!" in 10 different programming languages.
PHP
<?php
// Hello World in PHP
echo 'Hello World!';
?>
C#
//Hello World in C#
class HelloWorld
{
static void Main()
{
System.Console.Writ eLine("Hello, World!");
}
JavaScript
<html>
<body>
<script language="JavaScript" type="text/javascript">
// Hello World in JavaScript
document.write('Hello World');
</script>
</body>
</html>
Perl
# Hello world in perl
print "Hello World!\n";
C
/* Hello World in C */
#include <stdio.h>
main()
{
printf ("Hello World!\n");
}
Ruby
# Hello World in Ruby
puts "Hello World!"
Java
// Hello World in Java
class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}
Python
# Hello World in Python
print "Hello World"
VisualBasic.NET
'Hello World in Visual Basic .NET (VB.NET)
Imports System.Console
Class HelloWorld
Public Shared Sub Main()
WriteLine("Hello, world!")
End Sub
End Class
}
Pascal
program Hello;
begin
writeln ('Hello World!')
end.
If you learn PHP you can easily understand C and vice versa and same with others, because they are related to each other. Below is the programming code for "Hello World!" in 10 different programming languages.
PHP
<?php
// Hello World in PHP
echo 'Hello World!';
?>
C#
//Hello World in C#
class HelloWorld
{
static void Main()
{
System.Console.Writ eLine("Hello, World!");
}
JavaScript
<html>
<body>
<script language="JavaScript" type="text/javascript">
// Hello World in JavaScript
document.write('Hello World');
</script>
</body>
</html>
Perl
# Hello world in perl
print "Hello World!\n";
C
/* Hello World in C */
#include <stdio.h>
main()
{
printf ("Hello World!\n");
}
Ruby
# Hello World in Ruby
puts "Hello World!"
Java
// Hello World in Java
class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}
Python
# Hello World in Python
print "Hello World"
VisualBasic.NET
'Hello World in Visual Basic .NET (VB.NET)
Imports System.Console
Class HelloWorld
Public Shared Sub Main()
WriteLine("Hello, world!")
End Sub
End Class
}
Pascal
program Hello;
begin
writeln ('Hello World!')
end.
0 comments:
Post a Comment