Python/C/C++/JAVA

Basic Practice Programs with Code and Concept

By D.S

Write a Program to Add Two Numbers

"Hello, World!" program is basically a super simple program that just displays the message "Hello, World!" on the screen. Why is it so famous? Well, it’s often used by programmers as their first code example when learning a new programming language because it’s a great way to illustrate basic syntax. Essentially, it gives beginners a chance to get comfortable with coding logic and how different languages handle commands. Plus, it can be pretty rewarding to see your first program running successfully! So if you’re new to coding or just curious about this cheeky little program that pops up everywhere, give it a shot and see what all the hype is about.

(a.) C Code

#include <stdio.h>

    int main() {
        printf("Hello, World!
");
        return 0;
    }
Output:-
Hello, World!

(b.) C++ Code

#include <iostream>

    using namespace std;

    int main() {
        cout << "Hello, World!" << endl;
        return 0;
    }
Output:-
Hello, World!

(c.) Python Code

print("Hello, World!")
   
Output:-
Hello, World!

(d.) Java Code

public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("Hello, World!");
        }
    }
Output:-
Hello, World!