在如此众多的编程语言中你更喜欢哪一种呢?是C、C++、C#、JAVA………..还是LabVIEW?
许多编程语言的教科书中,都是通过介绍Hello-world程序来向读者展示出第一个程序示例作为开场白。我搜集了一些语言的该程序代码示例但未经编译运行,在这里仅作为展示比较。你更喜欢哪一种呢?我更喜欢G(LabVIEW也称为:G语言——图形化语言)。
C程序代码:
# include
int main ()
{
Printf (“Hello , World! \n”);
Return 0;
}
C++程序代码:
# include
Int main()
{
Std::cout<<’Hello , World !\n’;
return 0;
}
C# 程序代码:
class ConsoleHelloWorld
{
public static void main ()
{
System.Console.WriteLine(“Hello , World !”) ;
}
}
JAVA程序代码
public class
HelloWorldCommandLine{
public static vold main (String[ ] args){
System.out.printLn(“Hello,World!”);
}
}
Windows程序代码:
# include
Int WINAPI WinMain (HINSTANCE
hinstance,HINSTANCE hPrevlnstance,
PSTR szCmdLine,int
iCmdShow)
{
MessageBox(NULL,TEXT(“Hello, World
!”),TEXT
(“HelloMsg”,0);
returm 0;
}
VB程序代码:
Dim ny As Integer
Private Sub Form_Load ()
Ny=0
Text1.Text=”Hello , World
!”
Text1.ForeColor=RGB(255,0,0)
End Sub
LabVIEW程序代码:
http://www.ednchina.com/Upload/Blog//d9ef6e03-3840-471f-a5f4-672965003573.JPG