You need to build it first - and the code is wrong too.
This is the correct[ed] code:
#include<stdio.h>
int main () {
char name[20];
float score1, score2, score3, avg;
printf ("Please Enter your name:\n");
scanf ("%s", name);
printf ("Please enter you first score: ");
scanf ("%f", &score1);
printf ("Please enter you second score: ");
scanf ("%f", &score2);
printf ("Please enter you third score: ");
scanf ("%f", &score3);
avg = score1 + score2 + score3 / 3;
printf ("\n\n Name: %s\n", name);
printf ("score1: %-5.1f\n", score1);
printf ("score2: %-5.1f\n", score2);
printf ("score3: %-5.1f\n\n", score3);
printf ("Average: %-5.1f\n\n", avg);
return 0;
}
Now do:
gcc -o example4 example4.32.c
then to run it:
$ ./example4
Please Enter your name:
nick
Please enter you first score: 13
Please enter you second score: 14
Please enter you third score: 16
Name: nick
score1: 13.0
score2: 14.0
score3: 16.0
Average: 32.3
--
gcc header file broken or something.
https://bugs.launchpad.net/bugs/297209
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs