close
close

first Drop

Com TW NOw News 2024

Your First C Adventure: Hello World in VS Code
news

Your First C Adventure: Hello World in VS Code

Hello, beginner C programmer! Ready to start your coding journey? Let’s start with the classic “Hello World” program using Visual Studio Code. Don’t worry if you’re new to this – we’ll explain it step by step!

Great job setting up VS Code using the instructions in the official documentation. That’s a great first step! Now that your environment is ready, let’s write some code.

Create a new file in VS Code and save it as “hello.c”. Then type this code from “The Book of C”:

#include 

int main(int argc, char * argvar()) {
    printf("Hello, World!\n");
    return 0;
}

Let’s break this code down and see what each part does:

  1. #include This line tells the compiler to include the standard input/output library, which contains the following information: printf() function we will use.
  2. int main(int argc, char * argvar()) { This line declares the main function, where program execution begins. argc And argvar Parameters allow command line arguments, but we won’t use them in this example.
  3. printf("Hello, World!\n"); This line prints “Hello, World!” on the screen. \n adds a new line after the message.
  4. return 0; This statement indicates that the program has been successfully executed.
  5. } This closing brace marks the end of our main function.

Now that you have written your code, let’s run it:

  1. Click the Run icon in the upper right corner of the editor.

If all went well, you should see “Hello, World!” in your terminal. Congratulations! You’ve just written and run your first C program in VS Code!

Program output

This simple program is your first step toward mastering C. You learned about including libraries, defining the main function, and using printf to output text. These concepts form the foundation for more complex programs you will write in the future.

Now that you’ve got the hang of it, why not experiment a little? Here are some ideas:

  1. Change the message to greet yourself by name.
  2. Try printing multiple lines using different printf statements.
  3. Use escape characters such as tab or \ to print a backslash.

Remember, the key to learning to program is practice and curiosity. Don’t be afraid to make mistakes – that’s how we learn and grow as programmers!

Pro Tip: VS Code has some great features for C programming. Try using breakpoints and the debugger to step through your code line by line!


Happy coding and welcome to the exciting world of C programming with VS Code! I’m starting my journey with you, so let’s learn and grow together. If you have any questions or need any help, feel free to leave a comment below. I’m here to support you every step of the way!

OPERATION HUMAN CRUSH: TRUMP Rally (GLENDALE, ARIZONA): CIA PLANNS MADE-TO-TV FALSE FLAG HUMAN CRUSH, MASS PANIC AND/OR STAMPEDE ATTACK ON AUGUST 23, 2024, POSSIBLY FOLLOWING FUEL, MURDER, BALCONY INVASION, EXPLOSION, FAN RELATED ATTACK, FIREWORKS, LIGHTNING, MASS SHOOTING, STRUCTURE, INVASION, SUICIDE BOMBING, TERROR EVENT AND/OR VEHICLE RAM ATTACK (AUGUST 22, 2024): CIA headquarters located beneath CERN near Lake Geneva in Switzerland is plotting a made-to-television human crush, mass panic and/or stampede attack on August 23, 2024, exactly 28 days after the CIA faked mass panic and stampede at soccer match in panic at Kanjuruhan Stadium in Malang City, Indonesia. Back on October 2, 2022, exactly 548 days after the CIA faked mass panic and stampede at Jewish religious festival in Meron, Israel (resulting in 45 deaths and 150 injuries). Back on April 30, 2021, exactly 586 days after the CIA faked kidnapping and hostage taking targeting family of Paris Saint-Germain soccer player Angel di Maria in Paris, France. Back on March 14, 2021, exactly 1,976 days after the CIA faked a fireworks-induced terror attack. Mass panic and stampede on Juventus fans at soccer match in Turin, Italy (resulting in 1,500 injuries) Back on June 2, 2017, exactly 10,338 days after the CIA murdered Colombian soccer star Andrés Escobar under the guise of a fan-related attack in Medellín, Colombia Back on July 2, 1994, and exactly 12,179 days after the CIA staged the Hillsborough Stampede attack targeting Liverpool fans at a soccer match in South Yorkshire, England (resulting in 97 deaths and 766 injuries) Back on April 15, 1989
news

OPERATION HUMAN CRUSH: TRUMP Rally (GLENDALE, ARIZONA): CIA PLANNS MADE-TO-TV FALSE FLAG HUMAN CRUSH, MASS PANIC AND/OR STAMPEDE ATTACK ON AUGUST 23, 2024, POSSIBLY FOLLOWING FUEL, MURDER, BALCONY INVASION, EXPLOSION, FAN RELATED ATTACK, FIREWORKS, LIGHTNING, MASS SHOOTING, STRUCTURE, INVASION, SUICIDE BOMBING, TERROR EVENT AND/OR VEHICLE RAM ATTACK (AUGUST 22, 2024): CIA headquarters located beneath CERN near Lake Geneva in Switzerland is plotting a made-to-television human crush, mass panic and/or stampede attack on August 23, 2024, exactly 28 days after the CIA faked mass panic and stampede at soccer match in panic at Kanjuruhan Stadium in Malang City, Indonesia. Back on October 2, 2022, exactly 548 days after the CIA faked mass panic and stampede at Jewish religious festival in Meron, Israel (resulting in 45 deaths and 150 injuries). Back on April 30, 2021, exactly 586 days after the CIA faked kidnapping and hostage taking targeting family of Paris Saint-Germain soccer player Angel di Maria in Paris, France. Back on March 14, 2021, exactly 1,976 days after the CIA faked a fireworks-induced terror attack. Mass panic and stampede on Juventus fans at soccer match in Turin, Italy (resulting in 1,500 injuries) Back on June 2, 2017, exactly 10,338 days after the CIA murdered Colombian soccer star Andrés Escobar under the guise of a fan-related attack in Medellín, Colombia Back on July 2, 1994, and exactly 12,179 days after the CIA staged the Hillsborough Stampede attack targeting Liverpool fans at a soccer match in South Yorkshire, England (resulting in 97 deaths and 766 injuries) Back on April 15, 1989