C Compiler Validation In this activity, you will program your first "Hello World" C program. Execution Execute this project according to the following guidelines: Validate the C compiler is installed: Start the Ubuntu virtual machine. Open up the Terminal Type gcc in the terminal prompt. You might see an error message indicating that 'gcc' is currently not installed. If 'gcc' is not installed, then run the following commands from the terminal prompt: sudo apt-get update sudo apt-get install gcc Type gcc again in the terminal prompt. You should see that gcc ran, but is looking for input files to compile. This is OK. Create your first C program: Open up the Text Editor application. Type in the following C program: (image at the bottom) Save the file as c into your Applications folder created on your desktop. Compile your program: Open the Terminal application. Enter the following command: gcc HelloWorld.c -oHelloWorld.out Run a list command (enter ls) from the terminal prompt. You should now see the compiled binary output called HelloWorld.out. Enter the following in the terminal prompt: ./HelloWorld.out This should print the "Hello World" message to the terminal/console window. Edit the HelloWorld.c file by changing the printf string to "Hello World.\n I now know how to compile and run a C program!", recompile the program, and run the program. What do you see different?

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 1RQ: A structure that allows repeated execution of a block of statements is a(n) _____________. sequence...
icon
Related questions
Question

C Compiler Validation

In this activity, you will program your first "Hello World" C program.

Execution

Execute this project according to the following guidelines:

  1. Validate the C compiler is installed:
    1. Start the Ubuntu virtual machine.
    2. Open up the Terminal
    3. Type gcc in the terminal prompt. You might see an error message indicating that 'gcc' is currently not installed.
    4. If 'gcc' is not installed, then run the following commands from the terminal prompt:

sudo apt-get update

sudo apt-get install gcc

  1. Type gcc again in the terminal prompt. You should see that gcc ran, but is looking for input files to compile. This is OK.
  1. Create your first C program:
    1. Open up the Text Editor application.
    2. Type in the following C program:

(image at the bottom)

  1. Save the file as c into your Applications folder created on your desktop.
  2. Compile your program:
    1. Open the Terminal application.
    2. Enter the following command:

gcc HelloWorld.c -oHelloWorld.out

  1. Run a list command (enter ls) from the terminal prompt. You should now see the compiled binary output called HelloWorld.out.
  2. Enter the following in the terminal prompt:

./HelloWorld.out

  1. This should print the "Hello World" message to the terminal/console window.
  2. Edit the HelloWorld.c file by changing the printf string to "Hello World.\n I now know how to compile and run a C program!", recompile the program, and run the program. What do you see different?
/* Hello World program */
#include<stdio.h>
main ()
{
}
printf("Hello World\n");
Transcribed Image Text:/* Hello World program */ #include<stdio.h> main () { } printf("Hello World\n");
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr