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?
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?
Chapter5: Looping
Section: Chapter Questions
Problem 1RQ: A structure that allows repeated execution of a block of statements is a(n) _____________. sequence...
Related questions
Question
C Compiler Validation
In this activity, you will
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?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
Knowledge Booster
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.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr