Professional Documents
Culture Documents
Winter 2022
Lab 2
Navpreet Kaur
Student:
10270950
Student ID:
Section: 2
Explain what each line of code does in the Basic Calculations example;
Stdio.H is a header file that has the necessary information to include the
input/output related functions in our program.
#include <P18F458.h>is a processor specific library file.
specifies that the main function does not return any vlue.
int x, y, z;
x = 6;
y = 8;
z = x * y;
Exercises:
· Modify the Hello World program to use a for loop to print the phrase “Hello World,
my Fleming student number is; <insert student number>”, 10 times.
· Modify the Hello World program to use a while loop to print the phrase “Hello
World, my Fleming student number is; <insert student number>”, 15 times.
· Modify the Hello World program to use a do/while loop to print the phrase “Hello
World, my Fleming student number is; <insert student number>”, 35 times.