Ex1 of lab2 complete
This commit is contained in:
parent
a604b29e34
commit
1055c69c42
40
RountreeLabs/Lab02/ex1.c
Normal file
40
RountreeLabs/Lab02/ex1.c
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void){
|
||||||
|
double score1;
|
||||||
|
double score2;
|
||||||
|
double score3;
|
||||||
|
int return_code;
|
||||||
|
printf("Howdy You will now be asked to input the 3 scores\n");
|
||||||
|
printf("Score 1: ");
|
||||||
|
fflush(stdout);
|
||||||
|
return_code = scanf("%lg", &score1);
|
||||||
|
|
||||||
|
if(return_code != 1){
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
printf("Score 1 submitted succesfully\n");
|
||||||
|
printf("Score 2: ");
|
||||||
|
fflush(stdout);
|
||||||
|
return_code = scanf("%lg", &score2);
|
||||||
|
|
||||||
|
if (return_code != 1){
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Score 2 submitted succesfully\n");
|
||||||
|
printf("Score 3: ");
|
||||||
|
fflush(stdout);
|
||||||
|
return_code = scanf("%lg", &score3);
|
||||||
|
|
||||||
|
if (return_code != 1){
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Your scores were %f, %f, %f\n", score1, score2, score3);
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user