Professional Documents
Culture Documents
MATRIC: FPA/CS/15/3-0107
package welcome;
/**
*
* @author user
*/
public class Welcome {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Welcome to the world of programming");
}
}
OUTPUT
COMMENT ON JAVA
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package comment;
/**
*
* @author User
*/
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//this is single line comment
/*
this is multiple line comment
this is multiple line comment
*/
}
}
VISUAL BASIC
Module Module1
Sub Main()
Console.WriteLine("Welcome to the world of programming")
Console.ReadLine()
End Sub
End Module
Module Module1
Sub Main()
Dim a As Integer ' we declare A as integer
Dim b, c As Integer ' we declare variable b and c as integer
c = a + b ' the code added value of A and B together and stores the result into C
variable
Console.WriteLine(c)
' the last line above report the result of the arithmetic operation the screen through
the writeline function
End Sub
End Module
PASCAL CODE
program Project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
begin
writeln('WELCOME TO THE WORLD OF PROGRAMMING');
readln();
end.
COMMENT IN PASCAL
program Project1;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ you can add units after this };
var
a:integr; {the program declare A as integer}
b,c:integer; { this line declare B and C as Integer}
begin
c:=a+b; {Arithmetic operation is ised here}
writeln(c);
readln(); {this allow output of the source code to wait untill operation}
{ is performed on it}
end.
QBASIC COMMENT