Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Upload a screenshot for your Replit page after you complete the previous document. This screenshot should show ALL of the following: the name of your

Upload a screenshot for your Replit page after you complete the previous document. This screenshot should show ALL of the following: the name of your Replit project as well as your name under it (shown in the upper left corner of your Replit page) the "Files and Configuration" pane with the source code file and the generated binary file listed in this pane the "Code Editor" pane that shows the source code the "Output Sandbox" pane that shows the commands that you used as well as the output of executing the binarywhere you can write/edit the source code of your C command to invoke the C compiler) and see the output that
your program produces once it executes.
Since our "Hello World" program is a source code (in "main.c"
file), we need to compile it to a binary in order to be able to execute
it. To compile a C source code, Type the following command in the
Output Sandbox pane:
gcc main.c -o main_bin
After you type the command in the Output Sandbox pane, press the
"Enter $ " button on your keyboard. This will invoke the GCC
compiler system to compile your source code file into a binary file
that can be executed.
In the previous command:
gcc: is the command to invoke (i.e., call) the compiler that
we will be using to compile our C source code files.
main. c: is the name of our input source code (input to gcc
that we need to compile)
-0 : is an option provided to gcc to indicate the name of our
generated binary (i.e., the name of the output binary file that
will be generated after compiling the source code)
main_bin: is the name we choose for our generated Create a C Replit Project:
Once you are logged in to your Replit account, click on the "+
Create" button from the left tab.
Home
Templates
My Repls
My Oycles
community
Learn
Teams
Curricatum
A new pop-up window will appear. In the "Template" field type: C,
as shown in the image below in number 1. Then, from the options
that appear in the "Favorite" field, select "C replit", as shown in
number 2 below.
Create a Repl
Template binary. Here, the name we want for our generated binary
(can be any valid name) must come after the -0 option.
After we compile the source code (and generate the binary), we can
see the generated binary ("main_bin") in the Files and
Configuration pane, as shown below.
Files
Find a file
mainc
main_bin
In order to execute the generated binary (and see its output), type
the following command in the Output Sandbox pane:
./main_bin
After you type the command in the Output Sandbox pane, press the
"Enter d" button on your keyboard. This will execute the binary
and show the output of executing this binary in the same Output
Sandbox pane, as shown below.As we discussed earlier, our program in this project is a simple
"Hello World" program. We can see the output message "Hello
World" printed on the Output Sandbox pane as a result of executing
the "main_bin" binary file.
Important Note:
Do not use the green "???? Run" button on the top of Replit IDE.
This button may invoke commands that compile and execute your
source code for this example but may result in errors in future
assignments.
programs. In the Code Editor of our created project, you
can see a simple C program that prints a "Hello World"
message to a console, as shown below.
>f main
The left pane ("Files and Configuration") shows all files
that make up your project. Since we chose a C project
earlier, Replit has created one source code file ("main.c")
for our project, as shown below.
Files
Find a file
The right pane ("Output Sandbox") is similar to a Terminal
that you can use to type simple commands (e.g., a
mommand to inuake the C onmniler) and see the nutnut that
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions