Professional Documents
Culture Documents
Lab 1 Eng3202
Lab 1 Eng3202
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;
}
PSEUDOCODE
1
ERROR
2
3
AFTER DEBUG
OUTPUT
4
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;}
PSEUDOCODE
ERROR
5
AFTER DEBUG
OUTPUT
6
Listing 1.3
/* this program has error(s)
#include <stdio.h>
ERROR
7
DEBUG
OUTPUT
8
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*/
ERROR
9
DEBUG
OUTPUT
10
ANALYSIS/DISCUSSION
Listing 1.1
Listing 1.2
Listing 1.3
11
LISTING 1.4
12