0% found this document useful (0 votes)
57 views8 pages

Laboratory Activity No. 1

This document provides instructions for using the Turbo C integrated development environment (IDE) for writing and running C programs. It describes how to open the Turbo C application, access menu options using keyboard shortcuts, create a new file, write and save a sample "Hello World" program, run the program, and understand the basic structure and purpose of C code lines. The document also instructs the user to write and test a new C program that prints their details and save it to the specified folder.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views8 pages

Laboratory Activity No. 1

This document provides instructions for using the Turbo C integrated development environment (IDE) for writing and running C programs. It describes how to open the Turbo C application, access menu options using keyboard shortcuts, create a new file, write and save a sample "Hello World" program, run the program, and understand the basic structure and purpose of C code lines. The document also instructs the user to write and test a new C program that prints their details and save it to the specified folder.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Laboratory Activity No.

2
Notes:
1. Make sure you have created a folder in your D drive. (folder name: ME2)
2. Save your programs as prg1.c prg2.c prg3.c and so on and so forth.

1. Open TC.exe from desktop.

2. This window will show up on your screen

3. Type ALT F on your keyboard. What happens?


The sub menus from the file tab opens
4. What are the sub menus for the File menu?
Load (F3), Pick (Alt-F3), New, Save (F2), Write to, Directory, Change dir,
OS shell, Quit (Alt-X).
5. What keys do you think would you need to press to open the sub menus for
Edit? Run? Compile? Project? Options? Debug? Break? Provide screenshots.
Alt+E

Alt+R

Alt+C

Alt+P

Alt+O

Alt+D

Alt+B

6. The blue part of your Turbo C Environment is divided into two: Edit and
Message. The Edit Box is where you will type your programs and the Message
Box is where you will find messages from Turbo C (e.g errors, warnings, etc.)
7. To create a new file, do the ff:
a. ALT F
b. Arrow down to new

This creates a new file.

c. ALT F
d. Arrow down to write to

This saves your file on your specified path.


e. To check for the current file you are working with, check the upper right
corner of your edit box

f.

Press ALT E and type the following:


#include <stdio.h>
main()
{
printf(Hello World \n);
getch();
}

8. Once done typing, save your file. To save your file, press F2.
9. To run your program, press CTRL F9. Provide a screenshot of your program
below.

10.Press enter to go back to your edit window


11.Run your program again. What happens? Provide a screenshot below.

12.To clear the screen, add clrscr() to your code. What happens?

The second Hello World got deleted from the blue screen.

Meaning of each line of code:


#include <stdio.h>

this is your preprocessor directive. C must include various


libraries to support their codes. always start your codes with this
line.

main()

this is the start of the default function for your program. always
include this on your codes.

this serves as the opening of your program

printf(Hello World \n); this prints the word Hello World on the screen. \n means
new line or enter.
getch();

this prevents the screen from closing abruptly

end of program

Write a C program that will produce the following output. Replace with your details.
Save it on your folder in d drive. Provide screenshots of your code and your output.

You might also like