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.
This study source was downloaded by 100000853623340 from CourseHero.com on 09-28-2022 22:29:57 GMT -05:00
https://www.coursehero.com/file/132026063/hello-world-2rtf/
#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:
·0 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.
This study source was downloaded by 100000853623340 from CourseHero.com on 09-28-2022 22:29:57 GMT -05:00
https://www.coursehero.com/file/132026063/hello-world-2rtf/
·1 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.
This study source was downloaded by 100000853623340 from CourseHero.com on 09-28-2022 22:29:57 GMT -05:00
https://www.coursehero.com/file/132026063/hello-world-2rtf/
·2 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.
This study source was downloaded by 100000853623340 from CourseHero.com on 09-28-2022 22:29:57 GMT -05:00
https://www.coursehero.com/file/132026063/hello-world-2rtf/
·3 Write a program to convert the temperature from degrees Celsius to degrees
Fahrenheit, ranging from -200 degrees C to +200 degrees C, in increments of
20 degrees C. The program should display the table of results in the output
window only once.
This study source was downloaded by 100000853623340 from CourseHero.com on 09-28-2022 22:29:57 GMT -05:00
https://www.coursehero.com/file/132026063/hello-world-2rtf/
Powered by TCPDF (www.tcpdf.org)