Ex1 of lab2 complete

This commit is contained in:
lunarised 2019-04-19 16:46:19 +12:00
parent a604b29e34
commit 1055c69c42

40
RountreeLabs/Lab02/ex1.c Normal file
View 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;
}