01 LabManual ENG3202 2023-2024 Lab1
01 LabManual ENG3202 2023-2024 Lab1
Procedure
2. Locate and execute C programming IDE in your computer.
3. Enter listing 1.1 into the editor. Compile, run and debug the codes if necessary.
Listing 1.1
/* This program is to convert the temperature in Celsius to its corresponding
Fahrenheit value. Happy trying! */
#include stdio.h
int main
{
/* local declarations */
float Celsius,
int fahrenheit;
return 0;
}
4. Redo step 2 using listing 1.2, 1.3 and 1.4.
1
Listing 1.2
/* this is an example program
*
#include <stdio.h>
main
() {int num; printf (“This is”);
printf (“a program”
); printf
(
“that does not”
);printf(
“look too good.”
);
Printf
(“Enter a number >”);scanf(
“%d”,&num);printf
(“This is number%d”,
num);return
0;}
Listing 1.3
/* this program has error(s)
#include <stdio.h>
Listing 1.4
/this is another program with some errors in it and needs to be corrected/
#include (stdio.h)
a = 3 int;
b = 5.3 float, double;
c,d = a,b character;
/*statements
printf (The values are: , a,b,c,d);
printf(“the end of the program’)
return 0;
}/*main*/
-End-