Write hello program using different programming languages
✏๐Multi-Language Greetings: A Code Showcase in C, C++, Java, Python, and PHP ๐
C Programming Language (C) ๐
c#include<stdio.h>
int main() {
printf("Hello C language");
return 0;
}
Save this code as "hello.c". The extension ".c" signifies C programming. Note: "return 0" indicates successful execution, while "return 1" denotes unsuccessful execution.
Output of this program: Hello C language
C++ Programming Language (C++) ๐
cpp#include<iostream.h>
#include<conio.h>
int main() {
cout << "Hello C++ language";
return 0;
}
Save as "hello.cpp". The ".cpp" extension is for C++ programming.
Output: Hello C++ language
Java Programming Language (JAVA) ๐
javaclass main {
public static void main(String args[]) {
System.out.println("Hello JAVA");
}
}
Save as "hello.java". The ".java" extension is for JAVA programming.
Output: Hello JAVA
Python Programming Language (Python) ๐
python# Let's write our first Python file, called "hello.py"
print("Hello Python")
Save as "hello.py". The ".py" extension indicates Python programming.
Output: Hello Python
PHP Programming Language (PHP) ๐
php<!DOCTYPE>
<html>
<body>
<?php
echo "<h2>Hello PHP</h2>";
?>
</body>
</html>
Save as "hello.php". The ".php" extension denotes PHP programming.
Output: Hello PHP
I love this
ReplyDelete๐ค
Carry On ๐
ReplyDelete