910Lect code
This commit is contained in:
parent
2f83861249
commit
1762ad4c50
BIN
csci218/Lect/910.out
Executable file
BIN
csci218/Lect/910.out
Executable file
Binary file not shown.
15
csci218/Lect/910class.c
Normal file
15
csci218/Lect/910class.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
|
||||
int grade;
|
||||
|
||||
printf("Enter your grade: ");
|
||||
scanf("%d", &grade);
|
||||
|
||||
if (grade >= 90) {
|
||||
printf("You got an A!!\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
csci218/Lect/a.out
Executable file
BIN
csci218/Lect/a.out
Executable file
Binary file not shown.
24
csci218/Lect/tempClass.c
Normal file
24
csci218/Lect/tempClass.c
Normal file
@ -0,0 +1,24 @@
|
||||
//example of a simple program to display diffrent message for temperature
|
||||
#include <stdio.h>
|
||||
int main(){
|
||||
// display the purpose of the program
|
||||
printf("This program will display diffrent message for temperature.\n");
|
||||
|
||||
// define the variable temperature
|
||||
float temperature = 77;
|
||||
// check the temperature and display the message
|
||||
if (temperature < 32){
|
||||
printf("It is freezing outside.\n");
|
||||
printf("Wear a coat.\n");
|
||||
} else if (temperature < 50){
|
||||
printf("It is cold outside.\n");
|
||||
printf("Wear a jacket.\n");
|
||||
} else if (temperature < 70){
|
||||
printf("It is cool outside.\n");
|
||||
} else if (temperature < 90){
|
||||
printf("It is warm outside.\n");
|
||||
} else {
|
||||
printf("It is hot outside.\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
BIN
csci218/Lect/tempClass.out
Executable file
BIN
csci218/Lect/tempClass.out
Executable file
Binary file not shown.
10
csci218/Lect/welcome.c
Normal file
10
csci218/Lect/welcome.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
printf("Welcome! #%d\n", i + 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
csci218/Lect/welcome.out
Executable file
BIN
csci218/Lect/welcome.out
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user