Browse Source

Ex1 of lab2 complete

master
lunarised 5 years ago
parent
commit
1055c69c42
1 changed files with 40 additions and 0 deletions
  1. +40
    -0
      RountreeLabs/Lab02/ex1.c

+ 40
- 0
RountreeLabs/Lab02/ex1.c 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;
}


Loading…
Cancel
Save